From f3207164d5015de95799de67110ee2b011c23e82 Mon Sep 17 00:00:00 2001 From: dundargoc Date: Thu, 23 Nov 2023 11:30:26 +0100 Subject: [PATCH] fix: apply https://github.com/antirez/sds/pull/128 Needed to silence the -Wshadow warnings --- src/sds/sds.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/sds/sds.c b/src/sds/sds.c index 3a7eae72f7591b..6c333b7e86ed45 100644 --- a/src/sds/sds.c +++ b/src/sds/sds.c @@ -87,7 +87,7 @@ static inline char sdsReqType(size_t string_size) { * end of the string. However the string is binary safe and can contain * \0 characters in the middle, as the length is stored in the sds header. */ sds sdsnewlen(const void *init, size_t initlen) { - void *sh; + void *newsh; sds s; char type = sdsReqType(initlen); /* Empty strings are usually created in order to append. Use type 8 @@ -96,13 +96,13 @@ sds sdsnewlen(const void *init, size_t initlen) { int hdrlen = sdsHdrSize(type); unsigned char *fp; /* flags pointer. */ - sh = s_malloc(hdrlen+initlen+1); - if (sh == NULL) return NULL; + newsh = s_malloc(hdrlen+initlen+1); + if (newsh == NULL) return NULL; if (init==SDS_NOINIT) init = NULL; else if (!init) - memset(sh, 0, hdrlen+initlen+1); - s = (char*)sh+hdrlen; + memset(newsh, 0, hdrlen+initlen+1); + s = (char*)newsh+hdrlen; fp = ((unsigned char*)s)-1; switch(type) { case SDS_TYPE_5: {