"Ton van Overbeek" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> In article <[EMAIL PROTECTED]>, Alexandre Luz Barreto wrote:
> > I have a program that works fine on devices with palmos 4.1 and  early
> > but on OS 5.2 i get a invalid ptr error
> > whats wrong?
> >
> > ULong romVersion;
> > char *PalmOS = NULL;
> >
> > FtrGet(sysFtrCreator, sysFtrNumROMVersion, &romVersion);
> > StrIToH(PalmOS,romVersion);
> >
> >
>
> You have to allocate memory for the result string, which you obviously
> do not (char *PalmOS = NULL). StrIToH is now trying to write to address 0
> which is a big NoNo. So invalid ptr is correct. You are overwriting low
> memory on Palmos 4.x devices, which is a *bad* thing.

I'd strongly suggest you run your code on a debug emulator before releasing
it to any more victim^H^H^H^H^H^Husers, or you risk serious issues.

A debug emulator will help you pick up on a lot of programming errors such
as this one, and hopefully result in a much more stable product.

Alan



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

Reply via email to