ft_strtrim: corrected missing last word
This commit is contained in:
parent
8c2756952c
commit
0ef452afdc
@ -6,7 +6,7 @@
|
||||
/* By: tmaze <tmaze@student.42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2018/04/07 17:00:34 by tmaze #+# #+# */
|
||||
/* Updated: 2018/04/07 17:48:44 by tmaze ### ########.fr */
|
||||
/* Updated: 2018/04/08 16:33:22 by tmaze ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
@ -26,7 +26,7 @@ char *ft_strtrim(char const *s)
|
||||
i++;
|
||||
start = i;
|
||||
in_word = 1;
|
||||
while (s[i])
|
||||
while (i == 0 || s[i - 1])
|
||||
{
|
||||
if (in_word && (!ft_isprint(s[i]) || s[i] == ' '))
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user