Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
JennyHadir committed Oct 30, 2020
1 parent c96998c commit 56ac7fa
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 0 deletions.
1 change: 1 addition & 0 deletions _printf.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ int (*printer(char formati))(va_list)
{'R', print_rot13},
{'b', print_b},
{'r', print_r},
{'S', print_S},
{'\0', NULL}
};
int i = 0;
Expand Down
1 change: 1 addition & 0 deletions holberton.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,5 @@ int _putchar(char c);
int print_rot13(va_list arg);
int print_b(va_list arg);
int print_r(va_list arg);
int print_S(va_list arg);
#endif
17 changes: 17 additions & 0 deletions print_S.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#include "holberton.h"
#include <stdlib.h>
/**
* print_S - Print a string.
* @arg: String address.
* Return: integer.
*/
int print_S(va_list arg)
{
char *str = va_arg(arg, char *);
int i = 0;
if (str == NULL)
str = "(null)";
for (; str[i]; i++)
_putchar(str[i]);
return (i);
}

0 comments on commit 56ac7fa

Please sign in to comment.