Hi Chris,

<snip>
The location wasn't random. (I don't know where you got that idea).

What I meant was that once the corruption happens it could cause subsequent operations, which worked fine before, to be accessing invalid (or random) memory locations, thus causing crashes.
<snip>

char *st=MemPtrNew(20);
StrCopy(st,"Test");

you'll get a big problem on some (most?) systems because you didn't manually zero-out the memory first. Where in memory will it write "Test"? It will write it to the first NULL character position AFTER st, wherever that is. It is quite likely more than 20 characters beyond the location of st, so it will probably be overwriting something else, and


I think you are confusing StrCopy with strcat

You are right.  I meant to say StrCat.

Bob

--
For information on using the PalmSource Developer Forums, or to unsubscribe, 
please see http://www.palmos.com/dev/support/forums/

Reply via email to