fix a bug where maplist would seg on an empty map. d'oh :/

This commit is contained in:
Bill Currie 2000-11-02 21:14:43 +00:00
parent f933bbcc32
commit ef28d1b19f

View file

@ -310,16 +310,19 @@ maplist_print(struct maplist *maplist)
char *end; char *end;
char *name; char *name;
if (maplist->count) {
qsort(maplist->list, maplist->count, sizeof(char *), maplist_cmp); qsort(maplist->list, maplist->count, sizeof(char *), maplist_cmp);
for (i=0; i<maplist->count - 1; i++) { for (i=0; i<maplist->count - 1; i++) {
name = maplist->list[i]; name = maplist->list[i];
end = strstr (name, ".bsp"); end = strstr (name, ".bsp");
Con_Printf ("%-8.*s%c", end - name, name, ((i + 1) % 4) ? ' ' : '\n'); Con_Printf ("%-8.*s%c", end - name, name,
((i + 1) % 4) ? ' ' : '\n');
} }
name = maplist->list[i]; name = maplist->list[i];
end = strstr (name, ".bsp"); end = strstr (name, ".bsp");
Con_Printf ("%-9.*s\n", end - name, name); Con_Printf ("%-9.*s\n", end - name, name);
} }
}
void void
COM_Maplist_f ( void ) COM_Maplist_f ( void )