projects
/
open-adventure.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
ef24a63
)
Don't use a magic number when we can use sizeof().
author
Eric S. Raymond
<esr@thyrsus.com>
Tue, 23 May 2017 00:33:23 +0000
(20:33 -0400)
committer
Eric S. Raymond
<esr@thyrsus.com>
Tue, 23 May 2017 00:33:23 +0000
(20:33 -0400)
misc.c
patch
|
blob
|
history
diff --git
a/misc.c
b/misc.c
index ae39eb3be606f400b1a7c0f91392b9ce403e8ffd..7ab9ab543c723f921c89b84182d5884996719535 100644
(file)
--- a/
misc.c
+++ b/
misc.c
@@
-897,10
+897,10
@@
L15: if(!OPENED){
OPENED=fopen("adventure.text","r" /* NOT binary */);
if(!OPENED){printf("Can't read adventure.text!\n"); exit(0);}
}
- IGNORE(fgets(INLINE+1,
100
,OPENED));
+ IGNORE(fgets(INLINE+1,
sizeof(INLINE)-1
,OPENED));
L20: LNLENG=0;
-
/* 25 */ for (I=1; I<=100
&& INLINE[I]!=0; I++) {
+
/* 25 */ for (I=1; I<=sizeof(INLINE)
&& INLINE[I]!=0; I++) {
VAL=INLINE[I]+1;
INLINE[I]=MAP1[VAL];
L25: if(INLINE[I] != 0)LNLENG=I;