Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

New Cancer - Femgineers

Name: Anonymous 2012-06-08 14:20

Name: Anonymous 2012-06-12 9:37

>>121
Yep. vsnprintf() and vsprintf() don't allocate their own buffers, but all the others do.

fprintf generally looks something like this:
size_t fprintf(FILE* stream, const char* fmt, ...)
{
    char* buffer;
    va_list ap;
    va_start(ap, fmt);
    count = vsnprintf(NULL, 0, fmt, ap);
    buffer = malloc(count);
    count = vsnprintf(buffer, count, fmt, ap);
    va_end(ap);
    fputs(buffer, stream);
    free(buffer);
    return count;
}

or something along those lines.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List