X-Git-Url: https://jxself.org/git/?p=open-adventure.git;a=blobdiff_plain;f=dungeon.c;h=b22997da7c394b1d9d164f16ded7499697e8ae06;hp=4279dc90fc297cca51a9876ed1efbee3ef014108;hb=da883d53c09875635a9be1730371bebdaf9ef262;hpb=bc1dd279e28ace63b58c623bf0264a2eb837ff69 diff --git a/dungeon.c b/dungeon.c index 4279dc9..b22997d 100644 --- a/dungeon.c +++ b/dungeon.c @@ -29,7 +29,6 @@ static long LNLENG; static long LNPOSN; static char INLINE[LINESIZE+1]; static long OLDLOC; -static long MAXDIE; // Storage for what comes out of the database long LINUSE; @@ -198,7 +197,7 @@ void MAPLIN(FILE *OPENED) { while (!feof(OPENED) && INLINE[1] == '#'); LNLENG = 0; - for (size_t i = 1; i <= sizeof(INLINE) && INLINE[i] != 0; ++i) + for (size_t i = 1; i < sizeof(INLINE) && INLINE[i] != 0; ++i) { char val = INLINE[i]; INLINE[i] = ascii_to_advent[(unsigned)val]; @@ -215,7 +214,7 @@ long GETNUM(FILE *source) { * scanned). If we're at the end of the line or encounter an illegal * character (not a digit, hyphen, or blank), we return 0. */ - long DIGIT, GETNUM, SIGN; + long GETNUM, SIGN; if(source != NULL) MAPLIN(source); GETNUM = 0; @@ -236,7 +235,7 @@ long GETNUM(FILE *source) { } while (!(LNPOSN > LNLENG || INLINE[LNPOSN] == 0)) { - DIGIT=INLINE[LNPOSN]-64; + long DIGIT=INLINE[LNPOSN]-64; if(DIGIT < 0 || DIGIT > 9) { GETNUM=0;