diff --git a/arogue7/player.c b/arogue7/player.c index 55661a0..b481759 100644 --- a/arogue7/player.c +++ b/arogue7/player.c @@ -681,12 +681,13 @@ pick_spell(struct spells spells[], int ability, int num_spells, int power, } else { /* Now display the possible spells */ + /* type_cap is a workaround for code that tried to capitalize type by + * temporarily modifying it in place. */ + char type_cap = toupper(type[0]); wclear(hw); touchwin(hw); wmove(hw, 2, 0); - *type = toupper(*type); - wprintw(hw, " Cost %s", type); - *type = tolower(*type); + wprintw(hw, " Cost %c%s", type_cap, type + 1); mvwaddstr(hw, 3, 0, "-----------------------------------------------"); maxlen = 47; /* Maximum width of header */ @@ -733,9 +734,7 @@ pick_spell(struct spells spells[], int ability, int num_spells, int power, /* Design prompts */ sprintf(label, "Current %s power is %d", type, spell_left); - *type = toupper(*type); - sprintf(title, " Cost %s", type); - *type = tolower(*type); + sprintf(title, " Cost %c%s", type_cap, type + 1); sprintf(prbuf, "Select a %s or press Cancl to continue.", type); /* Set up the main menu structure */