-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhandle_i_neg_n_min.c
More file actions
32 lines (29 loc) · 1.16 KB
/
Copy pathhandle_i_neg_n_min.c
File metadata and controls
32 lines (29 loc) · 1.16 KB
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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* handle_i_neg_n_min.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: sprodatu <sprodatu@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/12/08 06:25:54 by sprodatu #+# #+# */
/* Updated: 2024/05/03 21:53:01 by sprodatu ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft/libft.h"
#include "ft_printf.h"
char *handle_i_neg_n_min(int *value, int *is_neg)
{
char *val_str;
if (*value == INT_MIN)
{
val_str = ft_strdup("2147483648");
*is_neg = 1;
}
else
{
if (*is_neg)
*value = -*value;
val_str = ft_itoa(*value);
}
return (val_str);
}