Fix 1986/marshall for linux

Choo choo! :-)

There was a problem in linux where it either segfaulted or entered an
infinite loop depending on compiler / flags. This was caused by a for
loop that had an empty condition and the call to _exit().

A game of cat and mouse occurred where fixing it for one compiler caused
the program to segfault with the other compiler. Unfortunately the
formatting did have to change a bit but it still mostly looks like a
train even if not quite as pretty.
This commit is contained in:
Cody Boone Ferguson committed 2023-07-12 11:42:15 -07:00
1 parent c093a0a805
commit affb0159ff
3 files changed
+19 -13

No files matched your search

+1 -1
View File
@@ -69,7 +69,7 @@ CINCLUDE=
# Optimization
#
OPT= -O3
OPT=
# Default flags for ANSI C compilation
#
+12 -12
View File
@@ -1,14 +1,14 @@
extern int
errno
;char
grrr
;main( r,
argv, argc ) char **argc ,
r ; char *argv[];{int P( );
#define x int i, j,cc[4];printf(" choo choo\n" ) ;
x ;if (P( ! i ) | cc[ ! j ]
errno
;char
grrr
;main( r,
argv, argc ) char **argc ,
r ; char *argv[];{ int P( );
#define x int i, j,cc[4]; printf(" choo choo\n" ) ;
x ;if (P( ! i ) | cc[ ! j ]
& P(j )>2 ? j : i ){* argv[i++ +!-i]
; for (i= 0;; i++ );
_exit(argv[(int)*argc-2/cc[1*(int)*argc]|-1<<4]);printf("%d",P(""));}}
P ( a ) char a ; { a ; while( a > " B "
/* - by E ricM arsh all- */); }
; /*for (i= 0;; i++ ); */
_exit(1/*argv[(int)*argc-2/cc[1*(int)*argc]|-1<<4]*/);printf("%d",P(""))
;}} P ( a ) char a ; { a ; /*while( a > " B "
* - by E ricM arsh all- )*/; }