From 92078a936afc1445641c9fbcaa77d656f0cd6403 Mon Sep 17 00:00:00 2001 From: Joe Wreschnig Date: Thu, 4 Apr 2013 12:38:17 +0200 Subject: [PATCH] Fix integer-size bug in score file parsing / printing. --- rip.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/rip.c b/rip.c index 809ba6a..352313d 100644 --- a/rip.c +++ b/rip.c @@ -155,12 +155,14 @@ char monst; if ((rogue_ver == 36) && (scorefile_ver == 2)) for(i = 0; i < 10; i++) { + int monster; encread((char *) &top_ten[i].sc_name, 80, fd); encread((char *) &top_ten[i].sc_login, 8, fd); encread((char *) scoreline, 100, fd); sscanf(scoreline, " %d %d %d %d \n", &top_ten[i].sc_score, &top_ten[i].sc_flags, - &top_ten[i].sc_level, &top_ten[i].sc_monster); + &top_ten[i].sc_level, &monster); + top_ten[i].sc_monster = monster; } /* @@ -194,7 +196,7 @@ char monst; printf("Top Ten Adventurers:\nRank\tScore\tName\n"); for (scp = top_ten; scp <= &top_ten[9]; scp++) { if (scp->sc_score) { - printf("%d\t%d\t%s: %s on level %d", scp - top_ten + 1, + printf("%ld\t%d\t%s: %s on level %d", scp - top_ten + 1, scp->sc_score, scp->sc_name, reason[scp->sc_flags], scp->sc_level); if (scp->sc_flags == 0) { -- 2.30.2