Merge branch 'master' of https://github.com/tvdu29/libft
This commit is contained in:
commit
aeb0181d74
2
Makefile
2
Makefile
@ -6,7 +6,7 @@
|
|||||||
# By: tmaze <tmaze@student.42.fr> +#+ +:+ +#+ #
|
# By: tmaze <tmaze@student.42.fr> +#+ +:+ +#+ #
|
||||||
# +#+#+#+#+#+ +#+ #
|
# +#+#+#+#+#+ +#+ #
|
||||||
# Created: 2018/04/07 12:47:06 by tmaze #+# #+# #
|
# 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 #
|
||||||
# #
|
# #
|
||||||
#******************************************************************************#
|
#******************************************************************************#
|
||||||
|
|
||||||
|
@ -6,11 +6,10 @@
|
|||||||
/* By: tmaze <tmaze@student.42.fr> +#+ +:+ +#+ */
|
/* By: tmaze <tmaze@student.42.fr> +#+ +:+ +#+ */
|
||||||
/* +#+#+#+#+#+ +#+ */
|
/* +#+#+#+#+#+ +#+ */
|
||||||
/* Created: 2018/05/16 11:41:02 by tmaze #+# #+# */
|
/* 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"
|
#include "libft.h"
|
||||||
|
|
||||||
char *ft_strnchr(const char *s, int c, int n)
|
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;
|
i = -1;
|
||||||
tmp = (char*)s;
|
tmp = (char*)s;
|
||||||
while ((++i == 0 || tmp[i - 1]) && n > 0 && i < n)
|
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)
|
if (tmp[i] == c)
|
||||||
return (&tmp[i]);
|
return (&tmp[i]);
|
||||||
}
|
|
||||||
return (NULL);
|
return (NULL);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user