diff options
Diffstat (limited to 'ft_putstr.c')
| -rw-r--r-- | ft_putstr.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/ft_putstr.c b/ft_putstr.c index 0e87847..ac402ed 100644 --- a/ft_putstr.c +++ b/ft_putstr.c @@ -6,7 +6,7 @@ /* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2019/10/07 09:52:12 by cacharle #+# #+# */ -/* Updated: 2019/10/07 09:52:15 by cacharle ### ########.fr */ +/* Updated: 2019/10/17 09:06:58 by cacharle ### ########.fr */ /* */ /* ************************************************************************** */ @@ -14,6 +14,12 @@ void ft_putstr(char const *s) { - while (*s) - write(STDOUT_FILENO, s++, 1); + int i; + + i = 0; + while (s[i]) + { + write(STDOUT_FILENO, &s[i], 1); + i++; + } } |
