diff options
-rw-r--r-- | fmacros.h | 2 | ||||
-rw-r--r-- | hiredis.h | 4 | ||||
-rw-r--r-- | test.c | 6 |
3 files changed, 6 insertions, 6 deletions
@@ -14,7 +14,7 @@ #define _XOPEN_SOURCE #endif -#if __APPLE__ && __MACH__ +#if defined(__APPLE__) && defined(__MACH__) #define _OSX #endif @@ -98,8 +98,8 @@ * 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'; \ - strncat((buf), err_str, ((len) - 1)); \ + strncpy((buf), err_str, ((len) - 1)); \ + buf[(len)-1] = '\0'; \ } \ } while (0) #endif @@ -328,12 +328,12 @@ static void test_reply_reader(void) { } static void test_free_null(void) { - void *redisContext = NULL; + void *redisCtx = NULL; void *reply = NULL; test("Don't fail when redisFree is passed a NULL value: "); - redisFree(redisContext); - test_cond(redisContext == NULL); + redisFree(redisCtx); + test_cond(redisCtx == NULL); test("Don't fail when freeReplyObject is passed a NULL value: "); freeReplyObject(reply); |