From 5fcd703aaea3794acfcaee35f91265d7ad2247ac Mon Sep 17 00:00:00 2001 From: genete Date: Wed, 12 Nov 2008 19:01:34 +0000 Subject: [PATCH] Stop a bunch of compile warnings about not used returned value from vasprintf function in _string.h file. git-svn-id: https://synfig.svn.sourceforge.net/svnroot/synfig@2190 1f10aa63-cdf2-0310-b900-c93c546f37ac --- ETL/trunk/ETL/_stringf.h | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) 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) -- 2.7.4