"Colla, Dr. Thomas J." wrote:
>
> Hello,
>
> is there anybody who knows why SysGetROMToken returns a buffer that is NOT
> terminated by '\0'?
> I would like to use this "string" to allow access to an application (and
> therefore need something like
> StrCompare) and - otherwise - display an allert containing this number. Both
> functions need a terminated
> string. Unfortunatelly, Char *serNum; StrNCopy(serNum, buffer,
> serialNumberLength) doesn't work (why?)
> Is there a work-around or should I read the Reference once again?
>
> Thanks in advance,
> Thomas
>
> --
> For information on using the Palm Developer Forums, or to unsubscribe, please see
>http://www.palmos.com/dev/tech/support/forums/
With this code I obtain the null terminated string at data:
static UInt16 size;
static char data[64];
static UInt8 *datap;
Int16 x;
SysGetROMToken((UInt16) 0,(UInt32) sysROMtokenSnum,&datap,&size);
for(x=0;x(size;x++)data[x]= *(datap+x);
data[x]= 0;
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/tech/support/forums/