forked from jbarbier/printf
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathoctal.c
More file actions
35 lines (30 loc) · 638 Bytes
/
octal.c
File metadata and controls
35 lines (30 loc) · 638 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
#include "holberton.h"
#include <stdlib.h>
#include <stdio.h>
/**
* conversion_o - checks validity of octals
* @s: format string ot check
* Return: 1 if checks and 0 and exits otherwise
*/
int conversion_o(char *s)
{
(void) s;
return (1);
}
/**
* make_octal - make an octal string
* @s: a format string
* @l: a va_list
* @buf: a pointer to the buf structure
* Return: a pointer to the result
*/
void make_octal(char *s, va_list l, buf_type *buf)
{
unsigned int n;
char *result;
(void) s;
n = va_arg(l, unsigned int);
result = base_conv(n, 8, "01234567");
fill_buffer(buf, result, _strlen(result));
free(result);
}