aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/hiredis/hiredis.h
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2016-01-11 16:21:43 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2016-01-11 16:21:43 +0000
commit83034f4027106b76d3458d911619d53479c85ea5 (patch)
treec1d1c11b4b557efb212d3f51b7cb54628d27c290 /contrib/hiredis/hiredis.h
parentd543bb540db79872e3fdf676d3aa1b858894b265 (diff)
downloadrspamd-83034f4027106b76d3458d911619d53479c85ea5.tar.gz
rspamd-83034f4027106b76d3458d911619d53479c85ea5.zip
Fix GNU version of strerror_r (hiredis is broken)
Diffstat (limited to 'contrib/hiredis/hiredis.h')
-rw-r--r--contrib/hiredis/hiredis.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/contrib/hiredis/hiredis.h b/contrib/hiredis/hiredis.h
index edba65886..62a903c0a 100644
--- a/contrib/hiredis/hiredis.h
+++ b/contrib/hiredis/hiredis.h
@@ -37,6 +37,7 @@
#include <stdarg.h> /* for va_list */
#include <sys/time.h> /* for struct timeval */
#include <stdint.h> /* uintXX_t, etc */
+#include <string.h> /* strerror_r, etc */
#include "sds.h" /* for sds */
#define HIREDIS_MAJOR 0
@@ -98,7 +99,7 @@
* then GNU strerror_r returned an internal static buffer and we \
* need to copy the result into our private buffer. */ \
if (err_str != (buf)) { \
- buf[(len)] = '\0'; \
+ buf[(len)-1] = '\0'; \
strncat((buf), err_str, ((len) - 1)); \
} \
} while (0)