Skip to content

Commit

Permalink
Fix handling of NULL button name
Browse files Browse the repository at this point in the history
  • Loading branch information
fragglet committed Dec 2, 2024
1 parent b3208ca commit bf37753
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/swgrpha.c
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ void swputsym(int x, int y, OBJECTS * ob)

static void PrintHelp(void)
{
const char *name;
char buf[64];
int i;
const struct {
Expand Down Expand Up @@ -115,8 +116,11 @@ static void PrintHelp(void)
swposcur(1, i + 3);
swputs(buf);
if (Vid_HaveController()) {
swposcur(21, i + 3);
swputs(Vid_ControllerButtonName(items[i].key));
name = Vid_ControllerButtonName(items[i].key);
if (name != NULL) {
swposcur(21, i + 3);
swputs(name);
}
}
}
snprintf(buf, sizeof(buf), "%-11s- %s", "Restart", "Ctrl-R");
Expand Down

0 comments on commit bf37753

Please # to comment.