Commit 0370c914 authored by Gabriel Genois's avatar Gabriel Genois

empty string

parent 479c39e0
Pipeline #88 passed with stages
in 57 seconds
......@@ -19,8 +19,6 @@ char *ft_strsub(char const *s, unsigned int start, size_t len)
size_t cur;
str = (char *)malloc(sizeof(*str) * (len + 1));
if (str == NULL)
return (NULL);
cur = 0;
while (cur < len)
{
......
......@@ -47,6 +47,7 @@ int main(int argc, char **argv)
}
else
{
/*
long unsigned int luo;
luo = 023;
long unsigned int luu;
......@@ -162,7 +163,7 @@ int main(int argc, char **argv)
ft_printf("\n\n=== Test s ===");
i = ft_printf("\nTest s-l -- %ls -- ", wchars); ft_putnbr(i);
*/
//i = ft_printf("==%s==\n", "Base build succeded");
//i = ft_printf("%-05%");
......@@ -175,8 +176,12 @@ int main(int argc, char **argv)
///i = ft_printf("%05%");
//i = ft_printf("@moulitest: %.x %.0x", 0, 0);
//i = ft_printf("Je suis un printf");
//ft_putchar('\n');
//ft_putnbr(i);
//i = ft_printf("%.2s is a string", "");
//i = ft_printf("%s is a string", "");
i = ft_printf("%% %", "test");
ft_putchar('\n');
ft_putnbr(i);
}
ft_putchar('\n');
return (0);
......
......@@ -84,7 +84,7 @@ void ftpf_types(char **input, va_list *data, int *size)
{
t_pfdata *dt;
char *percent;
dt = ftpf_initcontainer();
if (dt == NULL)
ft_putstr("\nWarning: Memory allocation error.\n");
......@@ -105,7 +105,8 @@ void ftpf_types(char **input, va_list *data, int *size)
{
percent = ft_strnew(1);
percent[0] = '%';
ft_lstadd(&dt->data, ft_lstnew(percent, 1));
ft_lstadd(&dt->data, ft_lstnew(percent, 2));
free(percent);
ftpf_numbers_put_lefpad(&dt, size);
}
if(dt->w > dt->s && dt->s > 0)
......@@ -113,7 +114,9 @@ void ftpf_types(char **input, va_list *data, int *size)
else
(*size) = (*size) + (dt->s > 0 ? dt->s : 0);
//ftpf_tmp_printpfdata(&dt);
free((*input));
if ((*input) != NULL)
free((*input));
(*input) = NULL;
(*size) = (*size) + ftpf_write(&dt);
ft_lstwipe(&dt->data);
ft_lstwipe(&dt->f);
......
......@@ -47,7 +47,8 @@ int ftpf_iscinlist(t_list **list, char c)
char ftpf_getcfl(t_list **lst)
{
char *s;
if ((*lst) == NULL)
return (0);
if ((*lst)->content_size <= 0)
return (0);
......
No preview for this file type
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment