MemHandle strH = MemHandleNew (maxSrtIToALen);
And just to preempt one more bug, this should be
MemHandle strH = MemHandleNew (maxStrIToALen + 1);
so that you leave space for the terminating null byte.
Palm OS is unfortunately very inconsistent about naming conventions for limits, but in general if the define is named xxxLen then it's the maximum string length, and you need to add one for the null byte, whereas if it's xxxSize then that includes the null.
-- Ken
Ps - Some exceptions to the naming convention I describe above include:
dmCategoryLength is 16, not 15
maxCurrencyNameLen is the buffer size
dmDBNameLength is the buffer size
dmMaxVersionStrLength is the buffer size
timeStringLength is the buffer size
userNameLen includes the null
pwdLength is the buffer size
countryNameLength is the buffer size
SysStringByIndex's maxLen parameter is the buffer size-- Ken Krugler TransPac Software, Inc. <http://www.transpac.com> +1 530-470-9200
-- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/
