From 32e97ccd7409faa7c0028480f30414a8aa0d1421 Mon Sep 17 00:00:00 2001 From: dholland Date: Mon, 28 Jan 2008 03:39:30 +0000 Subject: Add gcc printf format checking, and fix the abundant problems this revealed. (It appears that someone sometime thought that you use %d to print a long.) --- larn/display.c | 22 +++++++++++----------- larn/extern.h | 4 ++-- larn/global.c | 8 ++++---- larn/main.c | 23 +++++++++++++---------- larn/monster.c | 8 ++++---- larn/moreobj.c | 20 ++++++++++---------- larn/object.c | 20 ++++++++++---------- larn/scores.c | 12 ++++++------ larn/store.c | 32 ++++++++++++++++---------------- 9 files changed, 76 insertions(+), 73 deletions(-) (limited to 'larn') diff --git a/larn/display.c b/larn/display.c index ab59f2b0..54dd70cc 100644 --- a/larn/display.c +++ b/larn/display.c @@ -1,9 +1,9 @@ -/* $NetBSD: display.c,v 1.5 2004/01/27 20:30:30 jsm Exp $ */ +/* $NetBSD: display.c,v 1.6 2008/01/28 03:39:30 dholland Exp $ */ /* display.c Larn is copyrighted 1986 by Noah Morgan. */ #include #ifndef lint -__RCSID("$NetBSD: display.c,v 1.5 2004/01/27 20:30:30 jsm Exp $"); +__RCSID("$NetBSD: display.c,v 1.6 2008/01/28 03:39:30 dholland Exp $"); #endif /* not lint */ #include "header.h" @@ -64,18 +64,18 @@ bot_linex() if (cbak[SPELLS] <= -50 || (always)) { cursor(1, 18); if (c[SPELLMAX] > 99) - lprintf("Spells:%3d(%3d)", (long) c[SPELLS], (long) c[SPELLMAX]); + lprintf("Spells:%3ld(%3ld)", (long) c[SPELLS], (long) c[SPELLMAX]); else - lprintf("Spells:%3d(%2d) ", (long) c[SPELLS], (long) c[SPELLMAX]); - lprintf(" AC: %-3d WC: %-3d Level", (long) c[AC], (long) c[WCLASS]); + lprintf("Spells:%3ld(%2ld) ", (long) c[SPELLS], (long) c[SPELLMAX]); + lprintf(" AC: %-3ld WC: %-3ld Level", (long) c[AC], (long) c[WCLASS]); if (c[LEVEL] > 99) - lprintf("%3d", (long) c[LEVEL]); + lprintf("%3ld", (long) c[LEVEL]); else - lprintf(" %-2d", (long) c[LEVEL]); - lprintf(" Exp: %-9d %s\n", (long) c[EXPERIENCE], class[c[LEVEL] - 1]); - lprintf("HP: %3d(%3d) STR=%-2d INT=%-2d ", + lprintf(" %-2ld", (long) c[LEVEL]); + lprintf(" Exp: %-9ld %s\n", (long) c[EXPERIENCE], class[c[LEVEL] - 1]); + lprintf("HP: %3ld(%3ld) STR=%-2ld INT=%-2ld ", (long) c[HP], (long) c[HPMAX], (long) (c[STRENGTH] + c[STREXTRA]), (long) c[INTELLIGENCE]); - lprintf("WIS=%-2d CON=%-2d DEX=%-2d CHA=%-2d LV:", + lprintf("WIS=%-2ld CON=%-2ld DEX=%-2ld CHA=%-2ld LV:", (long) c[WISDOM], (long) c[CONSTITUTION], (long) c[DEXTERITY], (long) c[CHARISMA]); if ((level == 0) || (wizard)) @@ -84,7 +84,7 @@ bot_linex() lprcat(" ?"); else lprcat(levelname[level]); - lprintf(" Gold: %-6d", (long) c[GOLD]); + lprintf(" Gold: %-6ld", (long) c[GOLD]); always = 1; botside(); c[TMP] = c[STRENGTH] + c[STREXTRA]; diff --git a/larn/extern.h b/larn/extern.h index fe3af458..b32ccaa4 100644 --- a/larn/extern.h +++ b/larn/extern.h @@ -1,4 +1,4 @@ -/* $NetBSD: extern.h,v 1.5 2006/05/11 10:23:24 mrg Exp $ */ +/* $NetBSD: extern.h,v 1.6 2008/01/28 03:39:30 dholland Exp $ */ /* * Copyright (c) 1997 Christos Zoulas. All rights reserved. @@ -131,7 +131,7 @@ int lgetchar(void); void scbr(void); void sncbr(void); void newgame(void); -void lprintf(const char *, ...); +void lprintf(const char *, ...) __attribute__((__format__(__printf__, 1, 2))); void lprint(long); void lwrite(char *, int); long lgetc(void); diff --git a/larn/global.c b/larn/global.c index c4e75bfb..7f03c8b6 100644 --- a/larn/global.c +++ b/larn/global.c @@ -1,4 +1,4 @@ -/* $NetBSD: global.c,v 1.7 2001/02/05 00:57:33 christos Exp $ */ +/* $NetBSD: global.c,v 1.8 2008/01/28 03:39:31 dholland Exp $ */ /* * global.c Larn is copyrighted 1986 by Noah Morgan. @@ -23,7 +23,7 @@ */ #include #ifndef lint -__RCSID("$NetBSD: global.c,v 1.7 2001/02/05 00:57:33 christos Exp $"); +__RCSID("$NetBSD: global.c,v 1.8 2008/01/28 03:39:31 dholland Exp $"); #endif /* not lint */ #include @@ -95,7 +95,7 @@ raiseexperience(x) if (c[LEVEL] != i) { cursors(); beep(); - lprintf("\nWelcome to level %d", (long) c[LEVEL]); /* if we changed levels */ + lprintf("\nWelcome to level %ld", (long) c[LEVEL]); /* if we changed levels */ } bottomline(); } @@ -129,7 +129,7 @@ loseexperience(x) if (i != c[LEVEL]) { cursors(); beep(); - lprintf("\nYou went down to level %d!", (long) c[LEVEL]); + lprintf("\nYou went down to level %ld!", (long) c[LEVEL]); } bottomline(); } diff --git a/larn/main.c b/larn/main.c index d556f7f4..0a9592bb 100644 --- a/larn/main.c +++ b/larn/main.c @@ -1,9 +1,9 @@ -/* $NetBSD: main.c,v 1.18 2007/04/22 02:09:02 mouse Exp $ */ +/* $NetBSD: main.c,v 1.19 2008/01/28 03:39:31 dholland Exp $ */ /* main.c */ #include #ifndef lint -__RCSID("$NetBSD: main.c,v 1.18 2007/04/22 02:09:02 mouse Exp $"); +__RCSID("$NetBSD: main.c,v 1.19 2008/01/28 03:39:31 dholland Exp $"); #endif /* not lint */ #include @@ -327,7 +327,7 @@ qshowstr() sigsav = nosignal; nosignal = 1; /* don't allow ^c etc */ if (c[GOLD]) { - lprintf(".) %d gold pieces", (long) c[GOLD]); + lprintf(".) %ld gold pieces", (long) c[GOLD]); srcount++; } for (k = 26; k >= 0; k--) @@ -338,7 +338,7 @@ qshowstr() show3(j); k = 0; } - lprintf("\nElapsed time is %d. You have %d mobuls left", (long) ((gltime + 99) / 100 + 1), (long) ((TIMELIMIT - gltime) / 100)); + lprintf("\nElapsed time is %ld. You have %ld mobuls left", (long) ((gltime + 99) / 100 + 1), (long) ((TIMELIMIT - gltime) / 100)); more(); nosignal = sigsav; } @@ -612,9 +612,9 @@ show3(index) default: lprintf("\n%c) %s", index + 'a', objectname[iven[index]]); if (ivenarg[index] > 0) - lprintf(" + %d", (long) ivenarg[index]); + lprintf(" + %ld", (long) ivenarg[index]); else if (ivenarg[index] < 0) - lprintf(" %d", (long) ivenarg[index]); + lprintf(" %ld", (long) ivenarg[index]); break; } if (c[WIELD] == index) @@ -902,7 +902,7 @@ parse() case 'g': cursors(); - lprintf("\nThe stuff you are carrying presently weighs %d pounds", (long) packweight()); + lprintf("\nThe stuff you are carrying presently weighs %ld pounds", (long) packweight()); case ' ': yrepcount = 0; nomove = 1; @@ -911,7 +911,9 @@ parse() case 'v': yrepcount = 0; cursors(); - lprintf("\nCaverns of Larn, Version %d.%d, Diff=%d", (long) VERSION, (long) SUBVERSION, (long) c[HARDGAME]); + lprintf("\nCaverns of Larn, Version %ld.%ld, Diff=%ld", + (long) VERSION, (long) SUBVERSION, + (long) c[HARDGAME]); if (wizard) lprcat(" Wizard"); nomove = 1; @@ -947,7 +949,8 @@ parse() case 'P': cursors(); if (outstanding_taxes > 0) - lprintf("\nYou presently owe %d gp in taxes.", (long) outstanding_taxes); + lprintf("\nYou presently owe %ld gp in taxes.", + (long) outstanding_taxes); else lprcat("\nYou do not owe any taxes."); return; @@ -1146,7 +1149,7 @@ dropobj() amt = 32767000L; } c[GOLD] -= amt; - lprintf("You drop %d gold pieces", (long) amt); + lprintf("You drop %ld gold pieces", (long)amt); iarg[playerx][playery] = i; bottomgold(); know[playerx][playery] = 0; diff --git a/larn/monster.c b/larn/monster.c index 7a3c54e2..ab78b91e 100644 --- a/larn/monster.c +++ b/larn/monster.c @@ -1,4 +1,4 @@ -/* $NetBSD: monster.c,v 1.11 2007/04/22 02:09:02 mouse Exp $ */ +/* $NetBSD: monster.c,v 1.12 2008/01/28 03:39:31 dholland Exp $ */ /* * monster.c Larn is copyrighted 1986 by Noah Morgan. @@ -100,7 +100,7 @@ */ #include #ifndef lint -__RCSID("$NetBSD: monster.c,v 1.11 2007/04/22 02:09:02 mouse Exp $"); +__RCSID("$NetBSD: monster.c,v 1.12 2008/01/28 03:39:31 dholland Exp $"); #endif /* not lint */ #include @@ -130,7 +130,7 @@ createmonster(mon) if (mon < 1 || mon > MAXMONST + 8) { /* check for monster number * out of bounds */ beep(); - lprintf("\ncan't createmonst(%d)\n", (long) mon); + lprintf("\ncan't createmonst(%ld)\n", (long) mon); nap(3000); return; } @@ -623,7 +623,7 @@ ws: direct(x, fullhit(i), p, i); /* sleep */ return; default: - lprintf(" spell %d not available!", (long) x); + lprintf(" spell %ld not available!", (long) x); beep(); return; }; diff --git a/larn/moreobj.c b/larn/moreobj.c index ab236281..b9ace546 100644 --- a/larn/moreobj.c +++ b/larn/moreobj.c @@ -1,4 +1,4 @@ -/* $NetBSD: moreobj.c,v 1.6 2004/01/27 20:30:30 jsm Exp $ */ +/* $NetBSD: moreobj.c,v 1.7 2008/01/28 03:39:31 dholland Exp $ */ /* * moreobj.c Larn is copyrighted 1986 by Noah Morgan. @@ -9,7 +9,7 @@ */ #include #ifndef lint -__RCSID("$NetBSD: moreobj.c,v 1.6 2004/01/27 20:30:30 jsm Exp $"); +__RCSID("$NetBSD: moreobj.c,v 1.7 2008/01/28 03:39:31 dholland Exp $"); #endif /* not lint */ #include #include @@ -247,7 +247,7 @@ ochest() beep(); i = rnd(10); lastnum = 281; /* in case he dies */ - lprintf("\nYou suffer %d hit points damage!", (long) i); + lprintf("\nYou suffer %ld hit points damage!", (long) i); checkloss(i); switch (rnd(10)) { /* see if he gets a * curse */ @@ -347,7 +347,7 @@ ofountain() lprcat("wash yourself"); if (rnd(100) < 11) { x = rnd((level << 2) + 2); - lprintf("\nOh no! The water was foul! You suffer %d hit points!", (long) x); + lprintf("\nOh no! The water was foul! You suffer %ld hit points!", (long) x); lastnum = 273; losehp(x); bottomline(); @@ -424,14 +424,14 @@ fntchange(how) case 7: j = rnd(level + 1); if (how < 0) { - lprintf("You lose %d hit point", (long) j); + lprintf("You lose %ld hit point", (long) j); if (j > 1) lprcat("s!"); else lprc('!'); losemhp((int) j); } else { - lprintf("You gain %d hit point", (long) j); + lprintf("You gain %ld hit point", (long) j); if (j > 1) lprcat("s!"); else @@ -444,14 +444,14 @@ fntchange(how) case 8: j = rnd(level + 1); if (how > 0) { - lprintf("You just gained %d spell", (long) j); + lprintf("You just gained %ld spell", (long) j); raisemspells((int) j); if (j > 1) lprcat("s!"); else lprc('!'); } else { - lprintf("You just lost %d spell", (long) j); + lprintf("You just lost %ld spell", (long) j); losemspells((int) j); if (j > 1) lprcat("s!"); @@ -464,14 +464,14 @@ fntchange(how) case 9: j = 5 * rnd((level + 1) * (level + 1)); if (how < 0) { - lprintf("You just lost %d experience point", (long) j); + lprintf("You just lost %ld experience point", (long) j); if (j > 1) lprcat("s!"); else lprc('!'); loseexperience((long) j); } else { - lprintf("You just gained %d experience point", (long) j); + lprintf("You just gained %ld experience point", (long) j); if (j > 1) lprcat("s!"); else diff --git a/larn/object.c b/larn/object.c index 59df0215..43889b8b 100644 --- a/larn/object.c +++ b/larn/object.c @@ -1,10 +1,10 @@ -/* $NetBSD: object.c,v 1.10 2001/02/05 00:57:34 christos Exp $ */ +/* $NetBSD: object.c,v 1.11 2008/01/28 03:39:31 dholland Exp $ */ /* object.c Larn is copyrighted 1986 by Noah Morgan. */ #include #ifndef lint -__RCSID("$NetBSD: object.c,v 1.10 2001/02/05 00:57:34 christos Exp $"); +__RCSID("$NetBSD: object.c,v 1.11 2008/01/28 03:39:31 dholland Exp $"); #endif /* not lint */ #include "header.h" #include "extern.h" @@ -517,9 +517,9 @@ finditem(itm) default: if (tmp > 0) - lprintf("+ %d", (long) tmp); + lprintf("+ %ld", (long) tmp); else if (tmp < 0) - lprintf(" %d", (long) tmp); + lprintf(" %ld", (long) tmp); } lprcat("\nDo you want to (t) take it"); iopts(); @@ -571,7 +571,7 @@ ostairs(dir) lprcat("\nI hope you feel better. Showing anger rids you of frustration."); else { k = rnd((level + 1) << 1); - lprintf("\nYou hurt your foot dumb dumb! You suffer %d hit points", (long) k); + lprintf("\nYou hurt your foot dumb dumb! You suffer %ld hit points", (long) k); lastnum = 276; losehp(k); bottomline(); @@ -996,9 +996,9 @@ read_scroll(typ) case 7: gltime += (i = rnd(1000) - 850); /* time warp */ if (i >= 0) - lprintf("\nYou went forward in time by %d mobuls", (long) ((i + 99) / 100)); + lprintf("\nYou went forward in time by %ld mobuls", (long) ((i + 99) / 100)); else - lprintf("\nYou went backward in time by %d mobuls", (long) (-(i + 99) / 100)); + lprintf("\nYou went backward in time by %ld mobuls", (long) (-(i + 99) / 100)); adjusttime((long) i); /* adjust time for time warping */ return; @@ -1122,7 +1122,7 @@ opit() lprcat("\nYou fell into a pit! Your fall is cushioned by an unknown force\n"); } else { i = rnd(level * 3 + 3); - lprintf("\nYou fell into a pit! You suffer %d hit points damage", (long) i); + lprintf("\nYou fell into a pit! You suffer %ld hit points damage", (long) i); lastnum = 261; /* if he dies scoreboard * will say so */ } @@ -1265,7 +1265,7 @@ ogold(arg) i *= 1000; else if (arg == ODGOLD) i *= 10; - lprintf("\nIt is worth %d!", (long) i); + lprintf("\nIt is worth %ld!", (long) i); c[GOLD] += i; bottomgold(); item[playerx][playery] = know[playerx][playery] = 0; /* destroy gold */ @@ -1314,7 +1314,7 @@ ohome() died(269); } lprcat("\nThe diagnosis is confirmed as dianthroritis. He guesses that\n"); - lprintf("your daughter has only %d mobuls left in this world. It's up to you,\n", (long) ((TIMELIMIT - gltime + 99) / 100)); + lprintf("your daughter has only %ld mobuls left in this world. It's up to you,\n", (long) ((TIMELIMIT - gltime + 99) / 100)); lprintf("%s, to find the only hope for your daughter, the very rare\n", logname); lprcat("potion of cure dianthroritis. It is rumored that only deep in the\n"); lprcat("depths of the caves can this potion be found.\n\n\n"); diff --git a/larn/scores.c b/larn/scores.c index 975afc7d..ccddeb8a 100644 --- a/larn/scores.c +++ b/larn/scores.c @@ -1,4 +1,4 @@ -/* $NetBSD: scores.c,v 1.13 2007/04/22 02:09:02 mouse Exp $ */ +/* $NetBSD: scores.c,v 1.14 2008/01/28 03:39:31 dholland Exp $ */ /* * scores.c Larn is copyrighted 1986 by Noah Morgan. @@ -26,7 +26,7 @@ */ #include #ifndef lint -__RCSID("$NetBSD: scores.c,v 1.13 2007/04/22 02:09:02 mouse Exp $"); +__RCSID("$NetBSD: scores.c,v 1.14 2008/01/28 03:39:31 dholland Exp $"); #endif /* not lint */ #include #include @@ -268,7 +268,7 @@ winshou() if (p->order == i) { if (p->score) { count++; - lprintf("%10d %2d %5d Mobuls %s \n", + lprintf("%10ld %2ld %5ld Mobuls %s \n", (long) p->score, (long) p->hardlev, (long) p->timeused, p->who); } break; @@ -305,7 +305,7 @@ shou(x) if (sco[j].order == i) { if (sco[j].score) { count++; - lprintf("%10d %2d %s ", + lprintf("%10ld %2ld %s ", (long) sco[j].score, (long) sco[j].hardlev, sco[j].who); if (sco[j].what < 256) lprintf("killed by a %s", monster[sco[j].what].name); @@ -736,7 +736,7 @@ diedsub(x) int x; { char ch, *mod; - lprintf("Score: %d, Diff: %d, %s ", (long) c[GOLD], (long) c[HARDGAME], logname); + lprintf("Score: %ld, Diff: %ld, %s ", (long) c[GOLD], (long) c[HARDGAME], logname); if (x < 256) { ch = *monster[x].name; if (ch == 'a' || ch == 'e' || ch == 'i' || ch == 'o' || ch == 'u') @@ -775,7 +775,7 @@ diedlog() p = ctime(&logg.diedtime); p[16] = '\n'; p[17] = 0; - lprintf("Score: %d, Diff: %d, %s %s on %d at %s", (long) (logg.score), (long) (logg.diff), logg.who, logg.what, (long) (logg.cavelev), p + 4); + lprintf("Score: %ld, Diff: %ld, %s %s on %ld at %s", (long) (logg.score), (long) (logg.diff), logg.who, logg.what, (long) (logg.cavelev), p + 4); #ifdef EXTRA if (logg.moves <= 0) logg.moves = 1; diff --git a/larn/store.c b/larn/store.c index eaa92e52..c598cd39 100644 --- a/larn/store.c +++ b/larn/store.c @@ -1,4 +1,4 @@ -/* $NetBSD: store.c,v 1.10 2004/01/27 20:30:30 jsm Exp $ */ +/* $NetBSD: store.c,v 1.11 2008/01/28 03:39:31 dholland Exp $ */ /*- * Copyright (c) 1988 The Regents of the University of California. @@ -34,7 +34,7 @@ #if 0 static char sccsid[] = "@(#)store.c 5.4 (Berkeley) 5/13/91"; #else -__RCSID("$NetBSD: store.c,v 1.10 2004/01/27 20:30:30 jsm Exp $"); +__RCSID("$NetBSD: store.c,v 1.11 2008/01/28 03:39:31 dholland Exp $"); #endif #endif /* not lint */ @@ -240,7 +240,7 @@ dndstore() if (outstanding_taxes > 0) { lprcat("\n\nThe Larn Revenue Service has ordered us to not do business with tax evaders.\n"); beep(); - lprintf("They have also told us that you owe %d gp in back taxes, and as we must\n", (long) outstanding_taxes); + lprintf("They have also told us that you owe %ld gp in back taxes, and as we must\n", (long) outstanding_taxes); lprcat("comply with the law, we cannot serve you at this time. Soo Sorry.\n"); cursors(); lprcat("\nPress "); @@ -257,7 +257,7 @@ dndstore() dnd_hed(); while (1) { cursor(59, 18); - lprintf("%d gold pieces", (long) c[GOLD]); + lprintf("%ld gold pieces", (long) c[GOLD]); cltoeoln(); cl_dn(1, 20); /* erase to eod */ lprcat("\nEnter your transaction ["); @@ -335,7 +335,7 @@ dnditem(i) } else lprintf("%s", objectname[itm[i].obj]); cursor(j + 31, k); - lprintf("%6d", (long) (itm[i].price * 10)); + lprintf("%6ld", (long) (itm[i].price * 10)); } @@ -394,7 +394,7 @@ oschool() sch_hed(); while (1) { cursor(57, 18); - lprintf("%d gold pieces. ", (long) c[GOLD]); + lprintf("%ld gold pieces. ", (long) c[GOLD]); cursors(); lprcat("\nWhat is your choice ["); standout("escape"); @@ -531,7 +531,7 @@ banktitle(str) int i; lprcat("\n\nThe Larn Revenue Service has ordered that your account be frozen until all\n"); beep(); - lprintf("levied taxes have been paid. They have also told us that you owe %d gp in\n", (long) outstanding_taxes); + lprintf("levied taxes have been paid. They have also told us that you owe %ld gp in\n", (long) outstanding_taxes); lprcat("taxes, and we must comply with them. We cannot serve you at this time. Sorry.\n"); lprcat("We suggest you go to the LRS office and pay your taxes.\n"); cursors(); @@ -599,13 +599,13 @@ obanksub() cursor((k % 2) * 40 + 1, (k >> 1) + 4); lprintf("%c) %s", i + 'a', objectname[iven[i]]); cursor((k % 2) * 40 + 33, (k >> 1) + 4); - lprintf("%5d", (long) gemvalue[i]); + lprintf("%5ld", (long) gemvalue[i]); k++; }; cursor(31, 17); - lprintf("You have %8d gold pieces in the bank.", (long) c[BANKACCOUNT]); + lprintf("You have %8ld gold pieces in the bank.", (long) c[BANKACCOUNT]); cursor(40, 18); - lprintf("You have %8d gold pieces", (long) c[GOLD]); + lprintf("You have %8ld gold pieces", (long) c[GOLD]); if (c[BANKACCOUNT] + c[GOLD] >= 500000) lprcat("\nNote: Larndom law states that only deposits under 500,000gp can earn interest."); while (1) { @@ -691,9 +691,9 @@ obanksub() return; }; cursor(40, 17); - lprintf("%8d", (long) c[BANKACCOUNT]); + lprintf("%8ld", (long) c[BANKACCOUNT]); cursor(49, 18); - lprintf("%8d", (long) c[GOLD]); + lprintf("%8ld", (long) c[GOLD]); } } @@ -721,7 +721,7 @@ appraise(gemstone) amt = 50000; } else amt = (255 & ivenarg[j]) * 100; - lprintf("\nI can see this is an excellent stone, It is worth %d", (long) amt); + lprintf("\nI can see this is an excellent stone, It is worth %ld", (long) amt); lprcat("\nWould you like to sell it to us? "); yrepcount = 0; if (getyn() == 'y') { @@ -812,7 +812,7 @@ otradepost() value *= 2; while ((izarg-- > 0) && ((value = 14 * (67 + value) / 10) < 500000)); } - lprintf("\nItem (%c) is worth %d gold pieces to us. Do you want to sell it? ", i, (long) value); + lprintf("\nItem (%c) is worth %ld gold pieces to us. Do you want to sell it? ", i, (long) value); yrepcount = 0; if (getyn() == 'y') { lprcat("yes\n"); @@ -893,12 +893,12 @@ olrs() nxt: cursor(1, 6); if (outstanding_taxes > 0) - lprintf("You presently owe %d gp in taxes. ", (long) outstanding_taxes); + lprintf("You presently owe %ld gp in taxes. ", (long) outstanding_taxes); else lprcat("You do not owe us any taxes. "); cursor(1, 8); if (c[GOLD] > 0) - lprintf("You have %6d gp. ", (long) c[GOLD]); + lprintf("You have %6ld gp. ", (long) c[GOLD]); else lprcat("You have no gold pieces. "); } -- cgit v1.2.3-56-ge451