"Marco Pantaleoni" <[EMAIL PROTECTED]> wrote in message
news:76354@palm-dev-forum...
>
> On Mon, Feb 04, 2002 at 10:40:29AM -0800, Bob Whiteman wrote:
> >
> > char *GetResourceString( UInt16 id ) {
> >   static char string[256];
> ...
> >   if ( 255 == i ) string[256] = '\0';  // Make sure the string is
> > null-terminated
>
> this writes after the end of the string. A valid index value here is
> in range 0 - 255.


You're correct, it is off-by-one. That's what I get for posting code I wrote
off the top of my head. Thanks for pointing it out.

Bob Whiteman
Senior Software Engineer
Pico Communications



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

Reply via email to