projects
/
synfig.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Stop a bunch of compile warnings about not used returned value from vasprintf functio...
[synfig.git]
/
ETL
/
trunk
/
ETL
/
_stringf.h
diff --git
a/ETL/trunk/ETL/_stringf.h
b/ETL/trunk/ETL/_stringf.h
index
8173214
..
f91cfca
100644
(file)
--- a/
ETL/trunk/ETL/_stringf.h
+++ b/
ETL/trunk/ETL/_stringf.h
@@
-40,6
+40,14
@@
#define ETL_STRPRINTF_MAX_LENGTH (800)
#endif
#define ETL_STRPRINTF_MAX_LENGTH (800)
#endif
+#ifdef WIN32
+#define POPEN_BINARY_READ_TYPE "rb"
+#define POPEN_BINARY_WRITE_TYPE "wb"
+#else
+#define POPEN_BINARY_READ_TYPE "r"
+#define POPEN_BINARY_WRITE_TYPE "w"
+#endif
+
/* === T Y P E D E F S ===================================================== */
_ETL_BEGIN_CDECLS
/* === T Y P E D E F S ===================================================== */
_ETL_BEGIN_CDECLS
@@
-83,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;
#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)
return ret;
#else
#ifdef HAVE_VSNPRINTF // This is the secondary method (Safe, but bulky)
@@
-190,10
+201,12
@@
dirname(const std::string &str)
break;
if(iter==str.begin())
break;
if(iter==str.begin())
+ {
if (*iter==ETL_DIRECTORY_SEPARATOR)
return "/";
else
return ".";
if (*iter==ETL_DIRECTORY_SEPARATOR)
return "/";
else
return ".";
+ }
return std::string(str.begin(),iter);
}
return std::string(str.begin(),iter);
}