Re: Is this correct? [OT]

From: Robert Stankowic (pcdoktor_at_netway.at)
Date: 12/16/03


Date: Tue, 16 Dec 2003 11:23:08 +0100


"Martin Dickopp" <expires-2004-01-31@zero-based.org> schrieb im Newsbeitrag
news:brmj4s$aj0$01$2@news.t-online.com...
> "Robert Stankowic" <pcdoktor@netway.at> writes:
>
> > If he tries to modify _any_ part of this string literal, _very_
surprising
> > things may happen :)
> > strcpy(p, "my world");
> > will segfault if he is lucky. With some bad luck it will format his
> > harddisk, destroy his monitor (both can _really_ happen, believe me).
>
> Very true. A `void main (int argc, char **argv)' (in a program not written
> by me) almost destroyed my monitor once. I could only save it by pulling
> the power plug.

Yep. And a "wild" pointer (under DOS, with Watcom C) once really caused the
program to crash into the low level format routine and happily formatted my
HD.
It could, btw, as well play Tchernobyl and destroy certain brands of
mainboards with a writeable, but soldered BIOS chip.
Such is (C) life :)