>In article <63624@palm-dev-forum>, Ken Krugler <[EMAIL PROTECTED]> >wrote: > > > >This seems like a bug in the OS to me. > > > > No, it's a bug in your code. > >The point is that it took some serious digging to figure out what was >going on, and the answer turns out to be that the OS can't handle a null >in clipbord text. I agree that it was a little stupid of me to add it in >the first place, but how should I know it would cause such havoc? >Nowhere in the docs or the KB (that I could find) is there any warning >about it. It's vaguely implied in the description of ClipboardGetItem >(because the returned text doesn't include null), but that's the only >mention I saw. Did I miss something obvious? It wouldn't be the first >time.
You're right, a warning in the documentation for ClipboardAddItem would be useful. I've forwarded this to the tech writer. > > >..or at least a regrettable lack > > >of robustness in FldPaste :-) > > > > Possibly, but the question of how much checking can and should be > > done is a grey area. > >Agreed, and I don't expect the OS to save me from myself at all times, >But jeez, if a null in the clipboard can crash the system outside my own >app, then it should at least be documented. Better, perhaps >ClipboardAddItem should check for and strip null terminators in text >items so that it's simply never a problem. Stripping null terminators seems to start one down the slippery path of guessing what the programmer meant to do, and then correcting errors. But a check for a terminating null wouldn't be hard to add for the debug ROMs. I'll put that on my list. -- Ken Ken Krugler TransPac Software, Inc. <http://www.transpac.com> +1 530-470-9200 -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/tech/support/forums/
