MCPcopy Index your code
hub / github.com/GJDuck/e9patch / vfprintf

Function vfprintf

examples/stdlib.c:4156–4178  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4154 if (buf != buf_0) free(buf)
4155
4156static int vfprintf(FILE *stream, const char *format, va_list ap)
4157{
4158 va_list aq;
4159 va_copy(aq, ap);
4160 int result = vsnprintf(NULL, SIZE_MAX, format, ap);
4161 if (result >= 0)
4162 {
4163 ssize_t size = result+1;
4164 PRINTF_BUF_ALLOC(buf, size);
4165 if (buf != NULL)
4166 {
4167 result = vsnprintf(buf, size, format, aq);
4168 if (result >= 0)
4169 {
4170 if (fputs(buf, stream))
4171 result = -1;
4172 }
4173 PRINT_BUF_FREE(buf);
4174 }
4175 }
4176 va_end(aq);
4177 return result;
4178}
4179
4180static int vfprintf_unlocked(FILE *stream, const char *format, va_list ap)
4181{

Callers 7

fprintfFunction · 0.70
printfFunction · 0.70
errorFunction · 0.50
warningFunction · 0.50
debugImplFunction · 0.50
errorMethod · 0.50
debugMethod · 0.50

Calls 2

fputsFunction · 0.85
vsnprintfFunction · 0.70

Tested by

no test coverage detected