protected strchr & strlen
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
/* By: tmaze <marvin@42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2018/04/03 15:33:37 by tmaze #+# #+# */
|
||||
/* Updated: 2018/04/04 14:39:59 by tmaze ### ########.fr */
|
||||
/* Updated: 2018/05/16 15:33:46 by tmaze ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
@@ -17,7 +17,7 @@ size_t ft_strlen(const char *s)
|
||||
int i;
|
||||
|
||||
i = 0;
|
||||
while (s[i])
|
||||
while (s != NULL && s[i])
|
||||
i++;
|
||||
return (i);
|
||||
}
|
||||
|
Reference in New Issue
Block a user