Because Pelle added _vsnwprintf() to his libc.lib I have been able to add the wide char functions for str_asprintf() - these functions allocate the destination buffer, also added str_ccat.
Functions added
long str_ccat(char* pszDest, size_t cchDest, int numargs, ...);
long str_ccatx(char* pszDest, size_t cchDest, size_t* pLength, int numargs, ...);
long str_asprintf(char ** pszDest, const char* pszFormat, ...);
long str_asprintfx(char ** pszDest, size_t * pLength, const char* pszFormat, ...);
WideChar equivalents
long str_wccat(wchar_t* pszDest, size_t cchDest, int numargs, ...);
long str_wccatx(wchar_t* pszDest, size_t cchDest, size_t* pLength, int numargs, ...);
long str_aswprintf(wchar_t ** pszDest, const wchar_t* pszFormat, ...);
long str_aswprintfx(wchar_t ** pszDest, size_t * pLength, const wchar_t* pszFormat, ...);
=====================
str_ccat() will concatenate any number of null terminated strings. This is more efficient than using either str_sprintf or multiple calls to str_cat.
str_asprintf() allocates the required memory from the heap for the destination buffer, the buffer must be free-ed by the user.
As with all functions in this library (except str_asprintf) the destination size is passed making buffer overruns not possible - the 'X' functions will return the final size in pLength.
[can't find the attachment feature]
http://www.btinternet.com/~john.findlay1/Strlib.zipJohn