I've come across a bug when using sysAppLaunchCmdLookup to get info from
the Address app. The problem is in the parsing of some elements in the
format string which are compared using incorrect lengths, resulting in a
messed up return string. Sneaking a look at the code shows this snippet
in Address.c (I love having the source available :))
> static Handle LookupCreateResultString (LookupVariablesPtr vars,
> UInt recordNum, UInt phoneNum)
> .
> .
> .
> else if (StrNCompare(formatStringP, "work", 4) == 0) <--- ok
> {
> field = LookupFindPhoneField(vars, &record, addrLookupWork, phoneNum);
> formatStringP += 4; <--- ok
> }
> else if (StrNCompare(formatStringP, "home", 5) == 0) <--- oops, but works
> {
> field = LookupFindPhoneField(vars, &record, addrLookupHome, phoneNum);
> formatStringP += 5; <--- should be 4
> }
> else if (StrNCompare(formatStringP, "fax", 5) == 0) <--- should be 3
> {
> field = LookupFindPhoneField(vars, &record, addrLookupFax, phoneNum);
> formatStringP += 5; <--- should be 3
> }
> .
> .
> .
For brevity I've not quoted the "main" and "mobile" fields, which have
the same problem.
I've verified that the problem exists on at least the palmvii-rel-85
rom, not yet tested on others.
Anyway, my apologies if this has already been reported but I couldn't
find any mention in the KB and thought I should let people know.
--
Tony Williams,
Amazon Anywhere
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/tech/support/forums/