checked substr avec nv main

This commit is contained in:
hugodu69
2019-12-04 21:16:20 +01:00
parent 418b9e3af6
commit 328bce6316

View File

@@ -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);