{
char * dsc_turn = "Turn: ";
char * dsc_hitpoints = "\nHitpoints: ";
- char * dsc_score = "\nScore: ";
- uint16_t maxl = strlen(dsc_turn) + strlen(dsc_hitpoints) + strlen(dsc_score)
- + 5 + 3 + 5; /* Max strlens of strings of numbers to use. */
+ uint16_t maxl = strlen(dsc_turn) + 5 + strlen(dsc_hitpoints) + 3;
char text[maxl + 1];
- sprintf(text, "%s%d%s%d%s%d",
- dsc_turn, world.turn,
- dsc_hitpoints, world.player_lifepoints,
- dsc_score, world.score);
+ sprintf(text, "%s%d%s%d",
+ dsc_turn, world.turn, dsc_hitpoints, world.player_lifepoints);
add_text_with_linebreaks(win, text);
}
win->center.y = world.player_inventory_select;
char inventory_copy[strlen(world.player_inventory) + 1];
sprintf(inventory_copy, "%s", world.player_inventory);
- char * foo = inventory_copy;
+ char * strtok_target = inventory_copy;
uint8_t i = 0;
while (1)
{
- char * object = strtok(foo, "\n");
- foo = NULL;
+ char * object = strtok(strtok_target, "\n");
+ strtok_target = NULL;
if (NULL == object)
{
return;
{
char * title = "Active window's keybindings:";
struct KeyBinding * kb_p;
- struct Win * w = get_win_by_id(world.windb.active);
+ struct Win * w = get_win_by_id(world.winDB.active);
if (0 == w->view)
{
kb_p = w->kb.kbs;