On 12/13/99 11:57 AM, Thiago Rossato at [EMAIL PROTECTED] wrote:
>
>> retval = SysGetROMToken (0, sysROMTokenSnum, (BytePtr*) &bufP, &bufLen);
>
>
> try it:
>
> retval = SysGetROMToken (0, sysROMTokenSnum, (BytePtr*) &bufP, &bufLen);
> bufP [bufLen] = '\0';
>
Ouch... I believe you are writing that character into the system's memory...
not yours to write to.
A better method is to do a StrNCopy (into your own buffer) of bufLen
characters, then do the null termination as above to your own buffer space.
That way you can test to make sure that you are not overwriting memory.
StrNCopy will handle the case where those might be wide characters in some
future version.
HTH,
-- Lou
_________________________________________________________________
Lou Krieg, President Tel: (802) 865-2728
Green Mountain Software Corporation Fax: (802) 865-2468
85 Prim Road - Suite 302, PO Box 700 Internet: [EMAIL PROTECTED]
Colchester, Vermont 05446-0700 http://www.GMSW.com