forked from Vhex-Kernel-Core/fxlibc
![Yann MAGNIN](/assets/img/avatar_default.png)
@update > CMakeLists.txt | remove casiowin-* target (unused) | remove x86-generic target (unused) | update files location | remove old vhex sources files (deprecated, unused) > src/posix | remove this folder > src/libc | move its content to src/ | remove thread module > src/stdlib/reallocarray | check if the multiplication overflow failed | set appropriate errno value if multiplication failed
20 lines
346 B
C
20 lines
346 B
C
#include <stdio.h>
|
|
#include <fxlibc/printf.h>
|
|
|
|
int snprintf(char * restrict str, size_t size, char const * restrict fmt, ...)
|
|
{
|
|
/* This is valid even if str=NULL. */
|
|
struct __printf_output out = {
|
|
.str = str,
|
|
.size = size,
|
|
};
|
|
|
|
va_list args;
|
|
va_start(args, fmt);
|
|
|
|
int count = __printf(&out, fmt, &args);
|
|
|
|
va_end(args);
|
|
return count;
|
|
}
|