-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathft_printf_remove_min.c
33 lines (30 loc) · 1.1 KB
/
ft_printf_remove_min.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_printf_remove_min.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: mfrisby <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2017/07/11 13:13:56 by mfrisby #+# #+# */
/* Updated: 2017/07/11 13:13:58 by mfrisby ### ########.fr */
/* */
/* ************************************************************************** */
#include "libftprintf.h"
char *remove_min(t_env *e, char *tmp)
{
int i;
int y;
i = 1;
y = 0;
if (tmp[0] != '-')
return (tmp);
while (tmp[i])
{
tmp[y] = tmp[i];
i++;
y++;
tmp[y] = '\0';
}
e->neg = 1;
return (tmp);
}