Brian Preston wrote:
I just got an error where, after a StrCopy, the
destination char * array looked like:

my new string/0the old string/0/0/0

I thought StrCopy cleared out the destination char *
array first?

How would StrCopy() know the size of the destination? It doesn't even know it's an array, because it doesn't have to be an array.

Also, even if it did clear out the destination, that wouldn't
always be desirable.

If I'm doing it wrong, what's the right way?

The best thing (unless you are trying to wipe out sensitive data for security reasons) is to just leave the garbage in there. Why would it matter, anyway? I suppose it could matter if you are putting fixed-length strings in a PDB record or something, but I try to avoid fixed-length strings myself since they are less flexible.

  - Logan

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

Reply via email to