couple of reformatting bits

Some reformatting done while working on ATTRMAX().
This commit is contained in:
PatR
2022-10-12 02:19:38 -07:00
parent 02cfdfee30
commit 6e0fa50d80
2 changed files with 11 additions and 8 deletions
+5 -3
View File
@@ -260,14 +260,16 @@ cause_known(
/* format a characteristic value, accommodating Strength's strangeness */
static char *
attrval(int attrindx, int attrvalue,
char resultbuf[]) /* should be at least [7] to hold "18/100\0" */
attrval(
int attrindx,
int attrvalue,
char resultbuf[]) /* should be at least [7] to hold "18/100\0" */
{
if (attrindx != A_STR || attrvalue <= 18)
Sprintf(resultbuf, "%d", attrvalue);
else if (attrvalue > STR18(100)) /* 19 to 25 */
Sprintf(resultbuf, "%d", attrvalue - 100);
else /* simplify "18/ **" to be "18/100" */
else /* simplify "18/\**" to be "18/100" */
Sprintf(resultbuf, "18/%02d", attrvalue - 18);
return resultbuf;
}