Skip to content

Commit e61f9f5

Browse files
author
Mohamed El mouhib
committed
functions enhanced
1 parent 0d3bec9 commit e61f9f5

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

Makefile

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
CC = cc
22
CFLAGS = -Wall -Werror -Wextra
33
NAME = libftprintf.a
4-
SRC = ft_printf.c ft_putchar.c ft_putnbrhex.c ft_putunsigned.c ft_putaddres.c ft_putnbr.c ft_putstr.c
4+
SRC = ft_printf.c ft_putchar.c ft_putnbrhex.c ft_putunsigned.c \
5+
ft_putaddres.c ft_putnbr.c ft_putstr.c conversions.c
56
OBJ = $(SRC:.c=.o)
67

78
all : $(NAME)

ft_printf.c

+2-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
/* By: mel-mouh <[email protected]> +#+ +:+ +#+ */
77
/* +#+#+#+#+#+ +#+ */
88
/* Created: 2024/11/16 20:30:02 by mel-mouh #+# #+# */
9-
/* Updated: 2024/11/18 23:07:36 by mel-mouh ### ########.fr */
9+
/* Updated: 2024/11/19 11:43:39 by mel-mouh ### ########.fr */
1010
/* */
1111
/* ************************************************************************** */
1212

@@ -32,5 +32,6 @@ int ft_printf(const char *str, ...)
3232
count += ft_putchar(str[i]);
3333
i++;
3434
}
35+
va_end(args);
3536
return (count);
3637
}

libftprintf.h

+3-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
/* By: mel-mouh <[email protected]> +#+ +:+ +#+ */
77
/* +#+#+#+#+#+ +#+ */
88
/* Created: 2024/11/18 19:04:49 by mel-mouh #+# #+# */
9-
/* Updated: 2024/11/18 23:13:04 by mel-mouh ### ########.fr */
9+
/* Updated: 2024/11/19 11:21:21 by mel-mouh ### ########.fr */
1010
/* */
1111
/* ************************************************************************** */
1212

@@ -17,11 +17,12 @@
1717
# include <unistd.h>
1818
# include <stdarg.h>
1919

20+
int conversions(char spiecifier, va_list args);
21+
int ft_printf(const char *str, ...);
2022
int ft_putchar(char c);
2123
int ft_putstr(char *s);
2224
int ft_putnbr_hex(unsigned long int n, char *hexa);
2325
int ft_putnbr(int n);
24-
int ft_printf(const char *str, ...);
2526
int ft_putaddres(unsigned long int addr);
2627
int ft_putunsigned(unsigned int n);
2728

0 commit comments

Comments
 (0)