Define our own limited `fprintf` that avoids memory allocation. We do this using `snprintf` with a limited buffer.
| 343 | // Define our own limited `fprintf` that avoids memory allocation. |
| 344 | // We do this using `snprintf` with a limited buffer. |
| 345 | static void mi_vfprintf( mi_output_fun* out, void* arg, const char* prefix, const char* fmt, va_list args ) { |
| 346 | char buf[512]; |
| 347 | if (fmt==NULL) return; |
| 348 | if (!mi_recurse_enter()) return; |
| 349 | vsnprintf(buf,sizeof(buf)-1,fmt,args); |
| 350 | mi_recurse_exit(); |
| 351 | _mi_fputs(out,arg,prefix,buf); |
| 352 | } |
| 353 | |
| 354 | void _mi_fprintf( mi_output_fun* out, void* arg, const char* fmt, ... ) { |
| 355 | va_list args; |
no test coverage detected