sprintf.h File Reference


Detailed Description

Macros for typed block memory copy operations.

Go to the source code of this file.

Defines

#define INC_OSKI_SPRINTF_H
 oski/sprintf.h included.

Functions

char * oski_StringPrintf (const char *fmt,...)
 Safe implementation of 'sprintf' which returns a newly allocated string of the appropriate length to contain the desired formatted string.


Function Documentation

char* oski_StringPrintf const char *  fmt,
  ...
 

Safe implementation of 'sprintf' which returns a newly allocated string of the appropriate length to contain the desired formatted string.

Returns NULL on error. Otherwise, returns a newly allocated string containing the formatted output.

Note:
From David Martin at Berkeley: On AIX, Linux, and Solaris, vsnprintf() returns a value < len if the string buffer is sufficiently large to contain the formatted string, while the usual Irix implementation returns 0. Other systems are rumored to return a negative value on error. The 'if' condition below catches all 3 cases.

Here, we use 'len-1' to include the terminating NULL character.


Generated on Wed Sep 19 16:41:23 2007 for BeBOP Optimized Sparse Kernel Interface Library by  doxygen 1.4.6