I am just getting started with palm programming and am not sure about StrNCopy but the 
standard strncpy function in the c lib does
NOT null  terminate the string.



Derek Kite wrote:

> I am getting an error "Reading from memory management structure"
>
>         frm = FrmGetFormPtr(jobdetailsform);
>
>         // copy job number to top label
>         FrmCopyLabel(frm,detailsjobnumlabel,lap->jobdata.fields[inumber]);
>     if (StrLen(lap->jobdata.fields[icustomer]) > 24)
>     {
>                 tmpstr = MemPtrNew(26);
>                 tmpstr = StrNCopy(tmpstr,lap->jobdata.fields[icustomer],24);
> // --->HERE     FrmCopyLabel(frm,detailcustlabel,tmpstr);
>                 MemPtrFree(tmpstr);
>
>     }
>
> Does StrNCopy terminate the string with a NULL? All the data looks fine, tmpstr
> contains a truncated string as expected.
>
> Derek
>
> --
> For information on using the Palm Developer Forums, or to unsubscribe, please see 
>http://www.palmos.com/dev/tech/support/forums/

--
Chris Woodhouse



-- 
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