checked substr avec nv main
This commit is contained in:
@@ -15,7 +15,9 @@
|
||||
*/
|
||||
|
||||
/*
|
||||
** #include <libc.h>
|
||||
** #include <unistd.h>
|
||||
** #include <stdlib.h>
|
||||
** #include <stdio.h>
|
||||
**
|
||||
** char *ft_substr(char const *s, unsigned int start, size_t len);
|
||||
**
|
||||
@@ -61,10 +63,14 @@
|
||||
** int main(int ac, char **av)
|
||||
** {
|
||||
** char *str;
|
||||
** size_t size;
|
||||
** char *ret;
|
||||
**
|
||||
** str = "";
|
||||
** size_t size = 0;
|
||||
** char *ret = ft_substr(str, 5, size);
|
||||
** str = NULL;
|
||||
** size = 0;
|
||||
** ret = ft_substr(str, 5, size);
|
||||
** if (!ret)
|
||||
** return (0);
|
||||
** if (!ft_strncmp(ret, str + 5, size))
|
||||
** printf("gloups\n");
|
||||
** free(ret);
|
||||
|
||||
Reference in New Issue
Block a user