-
Notifications
You must be signed in to change notification settings - Fork 0
/
utils_second.c
42 lines (37 loc) · 1.36 KB
/
utils_second.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
34
35
36
37
38
39
40
41
42
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* utils_second.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: alex <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2021/01/13 17:51:02 by alex #+# #+# */
/* Updated: 2021/01/14 19:55:48 by alex ### ########.fr */
/* */
/* ************************************************************************** */
#include "printfhead.h"
int ft_find_max(int a, int b)
{
return ((a) > (b) ? (a) : (b));
}
char ft_check_hex(char tag, char check)
{
if ((tag == 'x' || tag == 'p') && check >= 'A' && check <= 'F')
return (check + 32);
else
return (check);
}
void ft_define_pointer(unsigned long n,
t_struct *blocks, int base)
{
unsigned long tmp;
tmp = n;
while (tmp > 0)
{
blocks->chars_to_print++;
tmp /= base;
}
blocks->width -= 2;
ft_print_p(n, blocks, base);
return ;
}