-
Notifications
You must be signed in to change notification settings - Fork 0
/
ft_printf_utils.c
89 lines (74 loc) · 1.71 KB
/
ft_printf_utils.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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_printf_utils.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: mbifenzi <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2019/12/22 17:38:37 by mbifenzi #+# #+# */
/* Updated: 2020/01/13 17:47:47 by mbifenzi ### ########.fr */
/* */
/* ************************************************************************** */
#include <stdarg.h>
#include <unistd.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include "ft_printf.h"
int ft_putstr1(char *s)
{
int i;
i = 0;
while (s[i])
{
ft_putchar(s[i++]);
}
return(i);
}
/*int ft_putstr2(char *s,int a)
{
int i;
int b;
i = 0;
b = a - strlen(s);
if (a > 0)
while (b--)
ft_putchar(' ');
while (s[i])
{
ft_putchar(s[i++]);
}
return(i);
}
*/
/*
int ft_itoa1(unsigned int n)
{
char *str;
long m;
int i;
int f;
int lens;
m = (long)n;
i = len(m);
lens = len(m);
f = 0;
if (!(str = malloc(sizeof(char) * (i + 1))))
return (0);
str[i] = '\0';
if (m < 0)
{
f = 1;
str[0] = '-';
m = m * (-1);
}
while (i-- > f)
{
str[i] = 48 + (m % 10);
m = m / 10;
}
ft_putstr(str);
free(str);
return (lens);
}
*/