I'm writing a library and want to make it absolutely resource-agnostic which also means that library should live with user-supplied memory allocation functions. Library allows user to set their own error handler function too, which are called with an error message as an argument, like that:
typedef void (*error_handler)(const char* msg);
Library code prepares error message by itself, somehow like that (with case when message formatting fails being omitted):
char buf[BUF_SIZE];
snprintf(buf, BUF_SIZE, "Oops found at file '%s' line %d", __FILE__, __LINE__);
But can I be sure that snprintf will not allocate even more memory for its internal usage with malloc, obviously bypassing user-supplied allocation routines? Man page in my Linux system keeps silence on that.