-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmy_S.c
More file actions
41 lines (37 loc) · 760 Bytes
/
my_S.c
File metadata and controls
41 lines (37 loc) · 760 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
/*
** my_S.c for in /u/epitech_2012/brenne_t/cu/rendu/c/my_printf
**
** Made by thomas brennetot
** Login <brenne_t@epitech.net>
**
** Started on Fri Dec 28 16:42:50 2007 thomas brennetot
** Last update Fri Dec 28 17:09:49 2007 thomas brennetot
*/
#include <stdarg.h>
#include <sys/types.h>
#include <sys/uio.h>
#include <unistd.h>
#include "my_printf.h"
void my_invisiblechar_in_octal(char c)
{
my_putchar('\\');
my_putnbr_base(c, "01234567");
return;
}
void my_printf_S(char *str, va_list *args)
{
int i;
char *str2;
i = 0;
str2 = va_arg(*args, char*);
while (str2[i] != '\0')
{
if (str[i] >= 32 && str[i] < 127)
write(1, &str2[i], 1);
else
my_invisiblechar_in_octal(str[i]);
i++;
}
str++;
return;
}