Fix fix on 2006/toledo - isolate FILE *, no longs

It turns out I had the right idea all along - some variables need to be
FILE *; the others can remain int. Since they're used as files I think
it seems better to have them be FILE * rather than longs even if that
technically works.
This commit is contained in:
Cody Boone Ferguson committed 2023-05-01 10:08:29 -07:00
1 parent 43287b6a4a
commit 005d8c0f93
2 files changed
+3 -9

No files matched your search

+2 -8
View File
@@ -20,14 +20,8 @@ make
[Cody Boone Ferguson](/winners.html#Cody_Boone_Ferguson) fixed a segfault in
this program which was making it fail to work under macOS - it did not seem to
be a problem under linux, at least not fedora. The problem was wrong variable
types - implicit `int`s instead of `longs` and two `FILE *`s. The `long` references
:-) were taken from [Yusuke Endoh](/winners.html#Yusuke_Endoh) and technically
it works if all the variables are `long` but this would trigger (if not
silenced) additional warnings and the correct type is `FILE *`. However changing
them all to `FILE *` (including some that are used as a file) cause compilation
errors. It might end up that a cast is sufficient or the wrong combination is
used but for now this will work and works with both macOS and linux. Thank you
Cody (and Yusuke)!
types - implicit `int`s instead of `FILE *`s. It now works with both macOS and
linux. Thank you Cody!
To end execution press `ctrl-z`. As mentioned in the author's remarks and in the
below section, it is supposed to crash on termination though Cody noted this
+1 -1
View File
@@ -19,7 +19,7 @@
unsigned char o[10],l[78114],*c=l,*k=l
#define d(e)o[e]+256*o[e-1]
#define h(l)s=l>>8&1|128&y|!(y&255)*64|16&z|2,y^=y>>4,y^=y<<2,y^=~y>>1,s|=y&4
+64506; FILE *u, *v; long e,V,x,y,z,Z; main(r,U)char**U;{
+64506; FILE *u, *v, *e, *V; int x,y,z,Z; main(r,U)char**U;{
{ { { } } } { { { } } } { { { } } } { { { } } }
{ { { } } } { { { } } } { { { } } } { { { } } }