Skip to content

Commit 5ce2482

Browse files
committed
fix: apply antirez/sds#128
Needed to silence the -Wshadow warnings
1 parent 6c4b5a8 commit 5ce2482

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/sds/sds.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ static inline char sdsReqType(size_t string_size) {
8787
* end of the string. However the string is binary safe and can contain
8888
* \0 characters in the middle, as the length is stored in the sds header. */
8989
sds sdsnewlen(const void *init, size_t initlen) {
90-
void *sh;
90+
void *newsh;
9191
sds s;
9292
char type = sdsReqType(initlen);
9393
/* Empty strings are usually created in order to append. Use type 8
@@ -96,13 +96,13 @@ sds sdsnewlen(const void *init, size_t initlen) {
9696
int hdrlen = sdsHdrSize(type);
9797
unsigned char *fp; /* flags pointer. */
9898

99-
sh = s_malloc(hdrlen+initlen+1);
100-
if (sh == NULL) return NULL;
99+
newsh = s_malloc(hdrlen+initlen+1);
100+
if (newsh == NULL) return NULL;
101101
if (init==SDS_NOINIT)
102102
init = NULL;
103103
else if (!init)
104-
memset(sh, 0, hdrlen+initlen+1);
105-
s = (char*)sh+hdrlen;
104+
memset(newsh, 0, hdrlen+initlen+1);
105+
s = (char*)newsh+hdrlen;
106106
fp = ((unsigned char*)s)-1;
107107
switch(type) {
108108
case SDS_TYPE_5: {

0 commit comments

Comments
 (0)