Forked from
redox-os / relibc
2463 commits behind the upstream repository.
-
Dan Robertson authored
Add implementations of sprintf and snprintf so that we can get a bit closer to compiling libc-test.
Dan Robertson authoredAdd implementations of sprintf and snprintf so that we can get a bit closer to compiling libc-test.
stdio.h 744 B
#ifndef _BITS_STDIO_H
#define _BITS_STDIO_H
int fprintf(FILE * stream, const char * fmt, ...) {
int ret;
va_list ap;
va_start(ap, fmt);
ret = vfprintf(stream, fmt, ap);
va_end(ap);
return ret;
}
int printf(const char * fmt, ...) {
int ret;
va_list ap;
va_start(ap, fmt);
ret = vprintf(fmt, ap);
va_end(ap);
return ret;
}
int snprintf(char *s, size_t n, const char * fmt, ...) {
int ret;
va_list ap;
va_start(ap, fmt);
ret = vsnprintf(s, n, fmt, ap);
va_end(ap);
return ret;
}
int sprintf(char *s, const char * fmt, ...) {
int ret;
va_list ap;
va_start(ap, fmt);
ret = vsprintf(s, fmt, ap);
va_end(ap);
return ret;
}
#endif /* _BITS_STDIO_H */