I reported the bug a couple of times, but I has been only partially fixed so far.
In older versions of PalmOS, the 3rd argument of StrNCompare was wrong is some cases, as well as the shift to formatStringP. Currently, it seems that Palm fixed the 3rd argument bug ONLY. Note that PhoneLookup Hack provides a full fix, provided that you use the feature through the PhoneNumberLookup() API. http://www.ablivio.com/plhack -- Denis Faivre - [EMAIL PROTECTED] -- Ablivio - http://www.ablivio.com ----- Message d'origine ----- De : "Tony Williams" <[EMAIL PROTECTED]> À : "Palm Developer Forum" <[email protected]> Envoyé : mercredi 19 juillet 2000 20:59 Objet : Bug in Address lookup with sysAppLaunchCmdLookup > 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/ > -- For information on using the ACCESS Developer Forums, or to unsubscribe, please see http://www.access-company.com/developers/forums/
