Skip to content

Commit

Permalink
Merge pull request #15 from Savapitech/fix_warn
Browse files Browse the repository at this point in the history
fix: fix all warning
  • Loading branch information
MarcAgen authored Oct 27, 2024
2 parents b8a0a9e + e7d582f commit c98ae71
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 18 deletions.
1 change: 1 addition & 0 deletions include/my.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ typedef struct {

char *baby_revstr(char *);
int baby_getnbr(char const *);
int baby_put_nbr(int);
int baby_put_hex(uintptr_t truc);
int baby_putchar(char);
int baby_putstr(char *);
Expand Down
1 change: 1 addition & 0 deletions src/handler/put_count_char.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,5 @@ int printf_count_char(flags_t *flags)
int *count = va_arg(flags->args, int *);

*count = flags->written;
return *count;
}
18 changes: 0 additions & 18 deletions src/handler/put_nbr.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,6 @@

#include "my.h"

static
int baby_put_nbr(int nb)
{
int count = 0;

if (nb < 0) {
count += baby_putchar('-');
nb *= -1;
}
if (nb < 10) {
count += baby_putchar(nb + '0');
} else {
count += baby_put_nbr(nb / 10);
count += baby_putchar(nb % 10 +'0');
}
return count;
}

int printf_put_nbr(flags_t *flags)
{
return baby_put_nbr(va_arg(flags->args, int));
Expand Down

0 comments on commit c98ae71

Please sign in to comment.