Often a problem is uninitialized variables. For example, a simple buggy program:

Char buf[20];
StrCat(buf, "hello");

This piece of code sometimes work, sometimes doesn't. buf contains
undefined characters. If buf[0] happens to be 0, this code will work.
If it happens to be non-zero, it won't. It happens that in debug
builds buf[0] is 0 and in relese builds it doesn't.

In order to fix this, you can do:
buf[0] = '\0'; or use MemSet() to fill out the buf with zeros. The
same applies to other kinds of variables (although compiler often will
warn you about using uninitialized variable) and dynamically allocated
memory.

Krzysztof Kowalczyk | http://blog.kowalczyk.info

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

Reply via email to