aboutsummaryrefslogtreecommitdiff
path: root/ft_strchr.c
diff options
context:
space:
mode:
Diffstat (limited to 'ft_strchr.c')
-rw-r--r--ft_strchr.c36
1 files changed, 24 insertions, 12 deletions
diff --git a/ft_strchr.c b/ft_strchr.c
index 67b969e..048b2ec 100644
--- a/ft_strchr.c
+++ b/ft_strchr.c
@@ -1,17 +1,29 @@
+/* ************************************************************************** */
+/* */
+/* ::: :::::::: */
+/* ft_strchr.c :+: :+: :+: */
+/* +:+ +:+ +:+ */
+/* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */
+/* +#+#+#+#+#+ +#+ */
+/* Created: 2019/10/07 10:14:47 by cacharle #+# #+# */
+/* Updated: 2019/10/07 10:40:04 by cacharle ### ########.fr */
+/* */
+/* ************************************************************************** */
+
#include <stdlib.h>
-char *ft_strchr(const char *s, int c)
+char *ft_strchr(const char *s, int c)
{
- char *cursor;
+ char *cursor;
- cursor = (char*)s;
- while (*cursor)
- {
- if (*cursor == (char)c)
- return (cursor);
- cursor++;
- }
- if (c == 0)
- return (cursor);
- return (NULL);
+ cursor = (char*)s;
+ while (*cursor)
+ {
+ if (*cursor == (char)c)
+ return (cursor);
+ cursor++;
+ }
+ if (c == 0)
+ return (cursor);
+ return (NULL);
}