ANSI-C compatibility changes

This commit is contained in:
antirez
2009-03-27 20:48:32 +01:00
parent 29fac6170a
commit a4d1ba9a73
5 changed files with 35 additions and 22 deletions

4
sds.c
View File

@ -278,8 +278,10 @@ sds *sdssplitlen(char *s, int len, char *sep, int seplen, int *count) {
for (j = 0; j < (len-(seplen-1)); j++) {
/* make sure there is room for the next element and the final one */
if (slots < elements+2) {
sds *newtokens;
slots *= 2;
sds *newtokens = zrealloc(tokens,sizeof(sds)*slots);
newtokens = zrealloc(tokens,sizeof(sds)*slots);
if (newtokens == NULL) {
#ifdef SDS_ABORT_ON_OOM
sdsOomAbort();