projects
/
collectd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
eb9df12
)
src/common.c: Copy the error-string to the buffer - no matter which implementation...
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
f8655a9
..
7555b7e
100644
(file)
--- a/
src/common.c
+++ b/
src/common.c
@@
-77,7
+77,15
@@
char *sstrerror (int errnum, char *buf, size_t buflen)
{
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 */