mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-01-17 22:50:51 +00:00
loop cleanup patch from ashridah
This commit is contained in:
parent
6342a9bdd7
commit
85cd891d8c
1 changed files with 1 additions and 17 deletions
|
@ -275,7 +275,6 @@ I_OGGMus_Info (void)
|
|||
plitem_t *currenttrack = NULL;
|
||||
int count = 0, iter = 0, highesttrack = 0;
|
||||
const char *trackstring;
|
||||
char **mapoutput = NULL;
|
||||
|
||||
if (!tracklist) {
|
||||
Sys_Printf ("\n" "No Tracklist\n" "------------\n");
|
||||
|
@ -308,11 +307,6 @@ I_OGGMus_Info (void)
|
|||
}
|
||||
Sys_DPrintf ("Highest Track number = %i.\n", highesttrack);
|
||||
|
||||
/* allocate a null terminated array of char *'s */
|
||||
mapoutput = calloc (highesttrack + 1, sizeof (char *));
|
||||
if (!mapoutput)
|
||||
Sys_Error ("couldn't allocate mapoutput array!\n");
|
||||
|
||||
/* loop until we've extracted 'numval' trackmaps, or hit the highest track
|
||||
* number */
|
||||
for (iter = 0, count = 0; (iter < ((plarray_t *) keylist->data)->numvals
|
||||
|
@ -323,20 +317,10 @@ I_OGGMus_Info (void)
|
|||
Sys_DPrintf ("Skipping trackstring: %s.\n", trackstring);
|
||||
continue;
|
||||
}
|
||||
mapoutput[iter] = nva (" %s - %s", trackstring,
|
||||
(char *) currenttrack->data);
|
||||
if (!mapoutput[iter])
|
||||
Sys_Error ("I_OGGMus: couldn't allocate mapstring!\n");
|
||||
Sys_Printf (" %s - %s\n", trackstring, (char *) currenttrack->data);
|
||||
iter++;
|
||||
}
|
||||
|
||||
/* output the map, and delete the allocated strings */
|
||||
for (iter = 0; (iter < ((plarray_t *) (keylist->data))->numvals); iter++) {
|
||||
Sys_Printf ("%s\n", mapoutput[iter]);
|
||||
free (mapoutput[iter]);
|
||||
}
|
||||
|
||||
free (mapoutput);
|
||||
PL_Free (keylist);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue