* In vasprintf when we have to produce a zero-length string:

* Assign the resulting pointer to the char** strp pointer
  * Return zero (instead of the pointer)


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2948 4a71c877-e1ca-e34f-864e-861f7616d084
master
Giel van Schijndel 2007-12-01 23:44:29 +00:00
parent 466b3c6248
commit ae79833367
1 changed files with 2 additions and 1 deletions

View File

@ -61,7 +61,8 @@ int vasprintf(char** strp, const char* format, va_list ap)
if (count == 0) if (count == 0)
{ {
return strdup(""); *strp = strdup("");
return 0;
} }
else if (count < 0) else if (count < 0)
{ {