summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: eb9df12)
raw | patch | inline | side by side (parent: eb9df12)
author | Florian Forster <octo@leeloo.lan.home.verplant.org> | |
Sun, 2 Sep 2007 16:38:47 +0000 (18:38 +0200) | ||
committer | Florian Forster <octo@leeloo.lan.home.verplant.org> | |
Sun, 2 Sep 2007 16:38:47 +0000 (18:38 +0200) |
src/common.c | patch | blob | history |
diff --git a/src/common.c b/src/common.c
index f8655a98ee5e33fd2b0621d884e1073cd193f462..7555b7ef99d26150d81193ce7e1d4d1a8e3a4b33 100644 (file)
--- a/src/common.c
+++ b/src/common.c
{
buf[0] = '\0';
#ifdef STRERROR_R_CHAR_P
- buf = strerror_r (errnum, buf, buflen);
+ {
+ char *temp;
+ temp = strerror_r (errnum, buf, buflen);
+ if (buf[0] == '\0')
+ {
+ strncpy (buf, temp, buflen);
+ buf[buflen - 1] = '\0';
+ }
+ }
#else
strerror_r (errnum, buf, buflen);
#endif /* STRERROR_R_CHAR_P */