MCPcopy Create free account
hub / github.com/GJDuck/e9patch / vfprintf_unlocked

Function vfprintf_unlocked

examples/stdlib.c:4180–4202  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4178}
4179
4180static int vfprintf_unlocked(FILE *stream, const char *format, va_list ap)
4181{
4182 va_list aq;
4183 va_copy(aq, ap);
4184 int result = vsnprintf(NULL, SIZE_MAX, format, ap);
4185 if (result >= 0)
4186 {
4187 ssize_t size = result+1;
4188 PRINTF_BUF_ALLOC(buf, size);
4189 if (buf != NULL)
4190 {
4191 result = vsnprintf(buf, result+1, format, aq);
4192 if (result >= 0)
4193 {
4194 if (fputs_unlocked(buf, stream))
4195 result = -1;
4196 }
4197 PRINT_BUF_FREE(buf);
4198 }
4199 }
4200 va_end(aq);
4201 return result;
4202}
4203
4204static int fprintf(FILE *stream, const char *format, ...)
4205{

Callers 2

fprintf_unlockedFunction · 0.85
printf_unlockedFunction · 0.85

Calls 2

fputs_unlockedFunction · 0.85
vsnprintfFunction · 0.70

Tested by

no test coverage detected