hiredis: Fix __redis_strerror_r lvalue error 4226/head
authorFlorian Fainelli <f.fainelli@gmail.com>
Sun, 2 Apr 2017 00:50:14 +0000 (17:50 -0700)
committerFlorian Fainelli <f.fainelli@gmail.com>
Sun, 2 Apr 2017 00:53:47 +0000 (17:53 -0700)
Fixes the following build error:
hiredis.h:101:24: error: lvalue required as left operand of assignment
             buf[(len)] = '\0';

Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
libs/hiredis/patches/001-lvalue_fix.patch [new file with mode: 0644]

diff --git a/libs/hiredis/patches/001-lvalue_fix.patch b/libs/hiredis/patches/001-lvalue_fix.patch
new file mode 100644 (file)
index 0000000..bf29f50
--- /dev/null
@@ -0,0 +1,13 @@
+Index: hiredis-0.13.3/hiredis.h
+===================================================================
+--- hiredis-0.13.3.orig/hiredis.h
++++ hiredis-0.13.3/hiredis.h
+@@ -98,7 +98,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)] = '\0';                                               \
+             strncat((buf), err_str, ((len) - 1));                              \
+         }                                                                      \
+     } while (0)