aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/hiredis/net.c
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/net.c
parentd543bb540db79872e3fdf676d3aa1b858894b265 (diff)
downloadrspamd-83034f4027106b76d3458d911619d53479c85ea5.tar.gz
rspamd-83034f4027106b76d3458d911619d53479c85ea5.zip
Fix GNU version of strerror_r (hiredis is broken)
Diffstat (limited to 'contrib/hiredis/net.c')
-rw-r--r--contrib/hiredis/net.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/contrib/hiredis/net.c b/contrib/hiredis/net.c
index 60a2dc754..e4aa920ad 100644
--- a/contrib/hiredis/net.c
+++ b/contrib/hiredis/net.c
@@ -66,11 +66,13 @@ static void redisContextCloseFd(redisContext *c) {
static void __redisSetErrorFromErrno(redisContext *c, int type, const char *prefix) {
char buf[128] = { 0 };
+ char *p;
size_t len = 0;
if (prefix != NULL)
len = snprintf(buf,sizeof(buf),"%s: ",prefix);
- __redis_strerror_r(errno, (char *)(buf + len), sizeof(buf) - len);
+ p = buf + len;
+ __redis_strerror_r(errno, p, sizeof(buf) - len);
__redisSetError(c,type,buf);
}