finally \o/

added ft_printf to libft
finalised ans tested ft_getline
This commit is contained in:
vagrant
2019-03-07 22:29:34 +00:00
parent 55767c36c6
commit 13d96a14d8
18 changed files with 75 additions and 81 deletions

View File

@@ -6,11 +6,11 @@
/* By: klebon <klebon@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2018/05/19 09:05:22 by klebon #+# #+# */
/* Updated: 2019/03/03 09:12:19 by klebon ### ########.fr */
/* Updated: 2019/03/07 22:27:38 by tmaze ### ########.fr */
/* */
/* ************************************************************************** */
#include "libftprintf.h"
#include "libft.h"
void ft_align_wstr(char *str, t_conv *field)
{
@@ -53,12 +53,12 @@ char *handle_output_str(t_conv *field, va_list ap)
if (field->fl_prec != -1)
len = (len > field->fl_prec) ? field->fl_prec : len;
field->str_size = (field->fl_witdth > len) ? field->fl_witdth : len;
if (!(output = ft_strnewb(field->str_size)))
if (!(output = ft_strnew(field->str_size)))
return (NULL);
if (field->fl_prec == -1)
ft_strcpy_s(output, str);
ft_strcpy(output, str);
else
ft_strncpy_s(output, str, len);
ft_strncpy(output, str, len);
ft_align_wstr(output, field);
return (output);
}