Skip to content

Commit

Permalink
fix for norminette. Remove ssize and write error handling
Browse files Browse the repository at this point in the history
  • Loading branch information
Extraden committed Dec 9, 2024
1 parent 71b9d83 commit 0187d49
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 10 deletions.
6 changes: 4 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,16 @@ CFLAGS = -Wall -Wextra -Werror

NAME = libftprintf.a

HEADER = ft_printf.h

OBJS = ft_printf.o ft_parse.o ft_num_ptr_functions.o ft_str_functions.o

all: $(NAME)

$(NAME): $(OBJS)
$(NAME): $(OBJS)
ar rcs $(NAME) $(OBJS)

%.o: %.c
%.o: %.c $(HEADER)
$(CC) $(CFLAGS) -c $< -o $@

clean:
Expand Down
7 changes: 3 additions & 4 deletions ft_parse.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,19 @@
/* By: dsemenov <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/11/28 15:56:14 by dsemenov #+# #+# */
/* Updated: 2024/12/04 18:18:17 by dsemenov ### ########.fr */
/* Updated: 2024/12/06 14:17:49 by dsemenov ### ########.fr */
/* */
/* ************************************************************************** */

#include "ft_printf.h"
#include <stdarg.h>
#include <stddef.h>

size_t ft_putchar(char c);
/*size_t ft_putchar(char c);
size_t ft_putstr(char *s);
size_t num_len(int n);
size_t ft_putnbr(int n);
size_t ft_puthex(unsigned int nbr, char *base);

*/
static size_t ft_parse_ptr(void *ptr)
{
size_t length;
Expand Down
2 changes: 1 addition & 1 deletion ft_printf.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
/* By: dsemenov <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/11/29 14:24:31 by dsemenov #+# #+# */
/* Updated: 2024/12/04 18:09:24 by dsemenov ### ########.fr */
/* Updated: 2024/12/09 12:51:40 by dsemenov ### ########.fr */
/* */
/* ************************************************************************** */

Expand Down
8 changes: 5 additions & 3 deletions ft_str_functions.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
/* By: dsemenov <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/12/04 18:19:22 by dsemenov #+# #+# */
/* Updated: 2024/12/04 18:28:24 by dsemenov ### ########.fr */
/* Updated: 2024/12/09 12:57:43 by dsemenov ### ########.fr */
/* */
/* ************************************************************************** */

Expand All @@ -19,15 +19,17 @@ size_t ft_putchar(char c)

size_t ft_putstr(char *s)
{
size_t res;
size_t i;

if (!s)
s = "(null)";
i = 0;
res = 0;
while (s[i])
{
ft_putchar(s[i]);
res += ft_putchar(s[i]);
i++;
}
return (i);
return (res);
}

0 comments on commit 0187d49

Please sign in to comment.