osdVSPrintf

osdVSPrintf

osd

1998 12-05


NAME

osdVSPrintf - print formatted output of a variable argument list


ARGUMENTS


fmt format of the output string as per sprintf(3S)
args arguments to print


SYNOPSIS

osdVSPrintf() formats the arguments args according the format specified by fmt, using the same specifiers as sprintf(3S). osdVSPrintf() allocates a string large enough to hold the formatted output, which must be deallocated by the caller, and populates it with the arguments.


RETURN

Returns a string containing the formatted output. It is the responsibility of the caller to deallocate the memory for this string.


EXAMPLE


void myfprintf(char *fmt, va_list args)
{
	char *s;
	s = osdVSPrintf(fmt, args);
	fprintf(stderr, "ERROR: %s\\n", s);
	osdFree(s);
}


SEE ALSO

osdSPrintf(3)


DIAGNOSTICS

Providing a null address as an argument to the string specifiers (e.g., "%s" ) will most likely result in a core dump.