X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Flibgame%2Fsetup.c;h=00168642fb95fb9665f46805699c6194a560f7ea;hb=891c39ca37c4fea5f6cc4ca40f913a56c68ef495;hp=446fb1e4470bfa326bb86856ffca8b1da4370127;hpb=8a1c6f39577584e0479ed638ed8b3df11d74f561;p=rocksndiamonds.git diff --git a/src/libgame/setup.c b/src/libgame/setup.c index 446fb1e4..00168642 100644 --- a/src/libgame/setup.c +++ b/src/libgame/setup.c @@ -1234,6 +1234,17 @@ SetupFileList *setListEntry(SetupFileList *list, char *token, char *value) return setListEntry(list->next, token, value); } +SetupFileList *addListEntry(SetupFileList *list, char *token, char *value) +{ + if (list == NULL) + return NULL; + + if (list->next == NULL) + return (list->next = newSetupFileList(token, value)); + else + return addListEntry(list->next, token, value); +} + #ifdef DEBUG static void printSetupFileList(SetupFileList *list) { @@ -1430,7 +1441,7 @@ static void *loadSetupFileData(char *filename, boolean use_hash) if (use_hash) setHashEntry((SetupFileHash *)setup_file_data, token, value); else - insert_ptr = setListEntry((SetupFileList *)insert_ptr, token, value); + insert_ptr = addListEntry((SetupFileList *)insert_ptr, token, value); } }