comparison rogue3/things.c @ 300:0250220d8cdd

Fix an assortment of compiler warnings. A few potential bugs were removed in the process. Much code cleanup remains to be done.
author John "Elwin" Edwards
date Fri, 22 Nov 2019 21:18:27 -0500
parents 527e2150eaf0
children
comparison
equal deleted inserted replaced
299:74351bf23e5e 300:0250220d8cdd
60 sprintf(prbuf, "%d %s potions", obj->o_count, 60 sprintf(prbuf, "%d %s potions", obj->o_count,
61 p_colors[obj->o_which]); 61 p_colors[obj->o_which]);
62 when FOOD: 62 when FOOD:
63 if (obj->o_which == 1) 63 if (obj->o_which == 1)
64 if (obj->o_count == 1) 64 if (obj->o_count == 1)
65 sprintf(prbuf, "A%s %s", vowelstr(fruit), fruit); 65 sprintf(prbuf, "A%s %.76s", vowelstr(fruit), fruit);
66 else 66 else
67 sprintf(prbuf, "%d %ss", obj->o_count, fruit); 67 sprintf(prbuf, "%d %.66ss", obj->o_count, fruit);
68 else 68 else
69 if (obj->o_count == 1) 69 if (obj->o_count == 1)
70 strcpy(prbuf, "Some food"); 70 strcpy(prbuf, "Some food");
71 else 71 else
72 sprintf(prbuf, "%d rations of food", obj->o_count); 72 sprintf(prbuf, "%d rations of food", obj->o_count);