mise a la norme

This commit is contained in:
Hugo LAMY
2020-03-12 22:33:55 +01:00
parent 02bd116005
commit 84b88d87d3
6 changed files with 46 additions and 7 deletions

View File

@@ -1,3 +1,14 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_printf.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: hulamy <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2020/03/12 22:31:29 by hulamy #+# #+# */
/* Updated: 2020/03/12 22:31:31 by hulamy ### ########.fr */
/* */
/* ************************************************************************** */
#include "ft_printf.h" #include "ft_printf.h"

View File

@@ -1 +0,0 @@
0x7ffee2d2e8a8

View File

@@ -1 +0,0 @@
0x7ffee2d2e8a8

View File

@@ -1,3 +1,14 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_convert.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: hulamy <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2020/03/12 22:30:05 by hulamy #+# #+# */
/* Updated: 2020/03/12 22:30:20 by hulamy ### ########.fr */
/* */
/* ************************************************************************** */
#include "ft_printf.h" #include "ft_printf.h"
@@ -81,10 +92,7 @@ char *ft_convert(va_list ap, char *type, char **s)
if ((tmp = ft_strchrset(type, "dic")) && ft_strchr(type, 'l')) if ((tmp = ft_strchrset(type, "dic")) && ft_strchr(type, 'l'))
return (conv_i(tmp[0], va_arg(ap, long int))); return (conv_i(tmp[0], va_arg(ap, long int)));
if ((tmp = ft_strchrset(type, "dic"))) if ((tmp = ft_strchrset(type, "dic")))
{
// ft_putstr("OK");
return (conv_i(tmp[0], va_arg(ap, int))); return (conv_i(tmp[0], va_arg(ap, int)));
}
if ((tmp = ft_strchrset(type, "uxXps")) && ft_strchrset(type, "lps")) if ((tmp = ft_strchrset(type, "uxXps")) && ft_strchrset(type, "lps"))
return (conv_u(tmp[0], va_arg(ap, unsigned long int))); return (conv_u(tmp[0], va_arg(ap, unsigned long int)));
if ((tmp = ft_strchrset(type, "uxX"))) if ((tmp = ft_strchrset(type, "uxX")))

View File

@@ -1,3 +1,14 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_flag_transform.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: hulamy <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2020/03/12 22:30:28 by hulamy #+# #+# */
/* Updated: 2020/03/12 22:30:41 by hulamy ### ########.fr */
/* */
/* ************************************************************************** */
#include "ft_printf.h" #include "ft_printf.h"
@@ -65,7 +76,6 @@ char *ft_precision(char *s, char *print, char *type)
if ((tmp = ft_strchr(s, '.'))) if ((tmp = ft_strchr(s, '.')))
{ {
precision = ft_atoi(tmp + 1); precision = ft_atoi(tmp + 1);
// *tmp = '\0';
while (*s && ft_strchr("#- +'0", *(++s))) while (*s && ft_strchr("#- +'0", *(++s)))
if (*s == '0') if (*s == '0')
*s = '/'; *s = '/';

View File

@@ -1,3 +1,14 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_flag_transform_bonus.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: hulamy <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2020/03/12 22:30:50 by hulamy #+# #+# */
/* Updated: 2020/03/12 22:30:57 by hulamy ### ########.fr */
/* */
/* ************************************************************************** */
#include "ft_printf.h" #include "ft_printf.h"
@@ -39,8 +50,9 @@ char *ft_sharp_again(char *s, char *print, char *type)
char *ft_space(char *s, char *print, char *type, int *size) char *ft_space(char *s, char *print, char *type, int *size)
{ {
int i = 0; int i;
i = 0;
if (print[0] == ' ' || !ft_strchr(s, ' ') || !ft_strchrset(type, "diuxX")) if (print[0] == ' ' || !ft_strchr(s, ' ') || !ft_strchrset(type, "diuxX"))
return (print); return (print);
while (print[i] == ' ') while (print[i] == ' ')