This commit is contained in:
Tanguy MAZE 2018-10-24 13:44:54 +02:00
commit aeb0181d74
2 changed files with 2 additions and 6 deletions

View File

@ -6,7 +6,7 @@
# By: tmaze <tmaze@student.42.fr> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2018/04/07 12:47:06 by tmaze #+# #+# #
# Updated: 2018/10/24 13:38:36 by tmaze ### ########.fr #
# Updated: 2018/10/08 14:33:36 by tmaze ### ########.fr #
# #
#******************************************************************************#

View File

@ -6,11 +6,10 @@
/* By: tmaze <tmaze@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2018/05/16 11:41:02 by tmaze #+# #+# */
/* Updated: 2018/05/16 11:56:15 by tmaze ### ########.fr */
/* Updated: 2018/10/08 15:21:15 by tmaze ### ########.fr */
/* */
/* ************************************************************************** */
#include <stdio.h>
#include "libft.h"
char *ft_strnchr(const char *s, int c, int n)
@ -21,10 +20,7 @@ char *ft_strnchr(const char *s, int c, int n)
i = -1;
tmp = (char*)s;
while ((++i == 0 || tmp[i - 1]) && n > 0 && i < n)
{
printf("loop %d\nc: %c\ntmp[i]: %c\n", i, c, tmp[i]);
if (tmp[i] == c)
return (&tmp[i]);
}
return (NULL);
}