sakiir

my_spec

Nov 16th, 2014
180
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.32 KB | None | 0 0
  1. int     my_spec(va_list p)
  2. {
  3.   char      *str;
  4.   int       i;
  5.  
  6.   i = 0;
  7.   str = va_arg(p, char *);
  8.   while (*str)
  9.     {
  10.       if (!is_printable_char(*str))
  11.     {
  12.       my_putstr("\\0");
  13.       i += 2;
  14.       i += my_putnbr_base(*str, "01234567");
  15.     }
  16.       else
  17.     {
  18.       my_putchar(*str);
  19.       i++;
  20.     }
  21.       str++;
  22.     }
  23.   return (i);
  24. }
Advertisement
Add Comment
Please, Sign In to add comment