strchrset renvois la place du premier char trouve

This commit is contained in:
hugodu69
2020-02-19 00:17:17 +01:00
parent bafcf928e4
commit 221f0536e3
2 changed files with 3 additions and 3 deletions

View File

@@ -33,7 +33,7 @@ int ft_toupper(int c);
int ft_tolower(int c);
char *ft_strchr(const char *s, int c);
char *ft_strrchr(const char *s, int c);
int ft_strchrset(char *s, char *set);
char *ft_strchrset(const char *s, const char *set);
int ft_strncmp(const char *s1, const char *s2, size_t n);
size_t ft_strlcpy(char *dst, const char *src, size_t size);
size_t ft_strlcat(char *dst, const char *src, size_t size);

View File

@@ -17,7 +17,7 @@
#include "libft.h"
int ft_strchrset(char *s, char *set)
char *ft_strchrset(const char *s, const char *set)
{
int i;
@@ -25,7 +25,7 @@ int ft_strchrset(char *s, char *set)
while (set[i] != '\0')
{
if (ft_strchr(s, set[i]) != NULL)
return (1);
return ((char *)set + i);
i++;
}
return (0);