X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=ETL%2Ftrunk%2FETL%2F_stringf.h;h=f91cfca48936881caa504771d354914675a6866d;hb=5fcd703aaea3794acfcaee35f91265d7ad2247ac;hp=69627993cb45c9caffdaca59d415bd95af831399;hpb=1317e750efd72bdb35780bdfad1e39cfabf98515;p=synfig.git diff --git a/ETL/trunk/ETL/_stringf.h b/ETL/trunk/ETL/_stringf.h index 6962799..f91cfca 100644 --- a/ETL/trunk/ETL/_stringf.h +++ b/ETL/trunk/ETL/_stringf.h @@ -91,9 +91,12 @@ vstrprintf(const char *format, va_list args) #ifdef HAVE_VASPRINTF // This is the preferred method (and safest) char *buffer; std::string ret; - vasprintf(&buffer,format,args); - ret=buffer; - free(buffer); + int i=vasprintf(&buffer,format,args); + if (i>-1) + { + ret=buffer; + free(buffer); + } return ret; #else #ifdef HAVE_VSNPRINTF // This is the secondary method (Safe, but bulky)