Update 1994/ldb - remove alt code & update README
The alt code served no purpose at all. Fixed formatting of README.md file.
This commit is contained in:
1 parent
7f5ee8ce42
commit
c87f1e36fc
3 files changed
+12
-25
No files matched your search
+2
-2
@@ -111,8 +111,8 @@ OBJ= ${PROG}.o
|
||||
DATA=
|
||||
TARGET= ${PROG}
|
||||
#
|
||||
ALT_OBJ= ${PROG}.alt.o
|
||||
ALT_TARGET= ${PROG}.alt
|
||||
ALT_OBJ=
|
||||
ALT_TARGET=
|
||||
|
||||
# FORCE use of -trigraphs
|
||||
#
|
||||
|
||||
+10
-22
@@ -15,17 +15,16 @@ make all
|
||||
[Cody Boone Ferguson](/winners.html#Cody_Boone_Ferguson) fixed this so it would
|
||||
compile and work with modern compilers. The problem was that `srand()` returns
|
||||
void but it was used in a `||` expression. Thus the comma operator was needed.
|
||||
Cody also changed the entry to use `fgets()` instead of `gets()` to make it
|
||||
safe for lines greater than 231 in length and to prevent a warning at linking or
|
||||
at runtime. Note that this now prints a newline after the output but this seems
|
||||
like a worthy compromise for making it safer (fixing it is more problematic than
|
||||
it is worth). In macOS another line of output would be shown anyway namely the
|
||||
warning that it uses gets(). A subtlety about this fix: if a line is greater
|
||||
than 231 in length if the program chooses that line it might print the first 231
|
||||
characters or it might print (up to) the next 231 characters and so on. Thank
|
||||
you Cody for your assistance!
|
||||
|
||||
For the original fixed version [ldb.alt.c](ldb.alt.c) see below.
|
||||
Cody also changed the entry to use `fgets()` instead of `gets()` to make it safe
|
||||
for lines greater than 231 in length and to prevent a warning at linking or at
|
||||
runtime, the latter of which can be interspersed with output of the program.
|
||||
Note that this now prints a newline after the output but this seems like a
|
||||
worthy compromise for making it safer (fixing it is more problematic than it is
|
||||
worth). In macOS another line of output would be shown anyway namely the warning
|
||||
that it uses gets(). A subtlety about this fix: if a line is greater than 231 in
|
||||
length if the program chooses that line it might print the first 231 characters
|
||||
or it might print (up to) the next 231 characters and so on. Thank you Cody for
|
||||
your assistance!
|
||||
|
||||
|
||||
## To run:
|
||||
@@ -47,17 +46,6 @@ printf "The International Obfuscated C Code Contest\n
|
||||
by Laurion Burchall" | ./ldb
|
||||
```
|
||||
|
||||
### Alternate code:
|
||||
|
||||
For the original version fixed so that it will compile with modern compiles,
|
||||
try:
|
||||
|
||||
```sh
|
||||
make alt
|
||||
```
|
||||
|
||||
Use `ldb.alt` as you would `ldb`.
|
||||
|
||||
## Judges' remarks:
|
||||
|
||||
Trigraphs are natural obfuscators. Most C-beautifiers become C-uglifiers
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
int _,O,__??('}'??);main(){while(O?gets((rand()%O++?':':_)+__)||puts(&__??(_??))&_:(srand(time((O+++_))),0)||O);}
|
||||
Reference in new issue
Block a user