Mail Archives: djgpp/1999/06/13/18:26:44
Eli Zaretskii wrote:
>
> On Sat, 12 Jun 1999, Grzegorz Jablonski wrote:
>
> > The problem occured, when I tried to
> > upgrade the program version from within the program itself.
>
> I don't see how this could cause any practical problems: the
> conventional memory usage by each subsidiary program is about 18KB, so
> you need much more than a single `exec' to eat up all the conventional
> memory, unless you have 20KB to begin with.
<chuckle> It breaks this interesting little Obfuscated C Contest winner
(Applin from 1995, line breaks changed):
main(v,c)char**c;{for(v[c++]="Hello, world!\n)";
(!!c)[*c]&&(v--||--c&&execlp(*c,*c,c[!!c]+!!c,!c));**c=!c)
write(!!*c,*c,!!**c);}
Yes, it execs itself for each letter of the message.
(Note: If you try it on Unix you should use -fwritable-strings to
compile.)
--
Nate Eldredge
nate AT cartsys DOT com
- Raw text -