Stop a bunch of compile warnings about not used returned value from vasprintf functio...
authorgenete <genete@1f10aa63-cdf2-0310-b900-c93c546f37ac>
Wed, 12 Nov 2008 19:01:34 +0000 (19:01 +0000)
committergenete <genete@1f10aa63-cdf2-0310-b900-c93c546f37ac>
Wed, 12 Nov 2008 19:01:34 +0000 (19:01 +0000)
git-svn-id: https://synfig.svn.sourceforge.net/svnroot/synfig@2190 1f10aa63-cdf2-0310-b900-c93c546f37ac

ETL/trunk/ETL/_stringf.h

index 6962799..f91cfca 100644 (file)
@@ -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)