added ft_getline WIP
This commit is contained in:
Tanguy MAZE
2019-03-07 19:06:02 +01:00
parent e6970465e9
commit 55767c36c6
20 changed files with 1686 additions and 7 deletions

30
ft_printf_tools_char.c Normal file
View File

@@ -0,0 +1,30 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* tools_char.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: klebon <klebon@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2018/05/19 08:51:48 by klebon #+# #+# */
/* Updated: 2018/10/30 12:35:10 by klebon ### ########.fr */
/* */
/* ************************************************************************** */
#include "libftprintf.h"
char *handle_output_char(t_conv *field, va_list ap)
{
char *output;
unsigned char c;
if (field->fl_type == percent)
c = '%';
else
c = (unsigned char)va_arg(ap, int);
field->str_size = (field->fl_witdth > 1) ? field->fl_witdth : 1;
if (!(output = ft_strnewb(field->str_size)))
return (NULL);
output[0] = c;
ft_align_wchar(output, field);
return (output);
}