Portability updates.

committer: mfx <mfx> 1054071025 +0000
This commit is contained in:
Markus F.X.J. Oberhumer
2003-05-27 21:30:25 +00:00
parent 757bdd1264
commit b2949259c5
13 changed files with 105 additions and 61 deletions
+9 -1
View File
@@ -116,8 +116,16 @@ void printErr(const char *iname, const Throwable *e)
if (l < sizeof(buf) && e->getMsg())
upx_snprintf(buf+l, sizeof(buf)-l, ": %s", e->getMsg());
l = strlen(buf);
if (l < sizeof(buf) && e->getErrno())
if (l < sizeof(buf) && e->getErrno()) {
upx_snprintf(buf+l, sizeof(buf)-l, ": %s", strerror(e->getErrno()));
#if 1
// some compilers (e.g. Borland C++) put a trailing '\n'
// into strerror() result
l = strlen(buf);
while (l-- > 0 && (buf[l] == '\n' || buf[l] == ' '))
buf[l] = 0;
#endif
}
pr_error(iname,buf,e->isWarning());
}