mirror of
https://salsa.debian.org/ha-team/libqb
synced 2026-08-09 22:49:43 +00:00
re-fix qb_strerror_r() in case caller frees buf.
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
This commit is contained in:
parent
9f5d0aebbb
commit
ca534c4df8
10
lib/unix.c
10
lib/unix.c
@ -38,14 +38,10 @@ qb_strerror_r(int errnum, char *buf, size_t buflen)
|
||||
#ifdef QB_LINUX
|
||||
return strerror_r(errnum, buf, buflen);
|
||||
#else
|
||||
char *out_buf;
|
||||
|
||||
if (strerror_r(errnum, buf, buflen) == 0) {
|
||||
out_buf = buf;
|
||||
} else {
|
||||
out_buf = (char*)"";
|
||||
if (strerror_r(errnum, buf, buflen) != 0) {
|
||||
buf[0] = '\0';
|
||||
}
|
||||
return out_buf;
|
||||
return buf;
|
||||
#endif /* QB_LINUX */
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user