>Subject: RE: StrNCompare & PalmOS4 (BUG!)
>From: "Richard Burmeister" <[EMAIL PROTECTED]>
>Date: Thu, 22 Mar 2001 11:48:47 -0600

>> From: Stringer
>>
>> All of us who have programming in C (and C++) for many years have
>> a reasonable expectation that the string functions containing 'n' and
>> taking a length parameter do not need null-terminated strings.
>> [snip]
>>
>> THIS IS A BUG!

><OPINION>
>I realize I'm entering a subjective area here, but I disagree.  StrNCompare
>!= strncmp.  The words do not have the same spelling, number of characters,
>or case.  C programmers should be very aware of these differences (Abc !=
>abc, etc.).  The mere fact that the words are different should cause you to
>question your assumptions about how they function and create test cases to
>verify how StrNCompare functions if the documentation wasn't clear.

>OTOH, I agree that it would be nice if everything worked the same
>everywhere.  But then we wouldn't have multiple languages, multiple OS's,
>multiple hardware platforms, and certainly not the same level of
>remuneration for our work.
></OPINION>

Palm OS claims to provide equivalents for the normal string handling
functions, such as strncmp(), which they advise us to use.   If they use 
a similar naming convention for a function, such a StrNCompare(), 
then they should produce an equivalent function.

If they want to create a function which acts differently, then
either;  They should use a different naming scheme, such as
        StrCompareLimited()
or; Explicitly document where this function differs

Can Palm Inc, comment on when StrNCompare() started requiring
null terminated strings.   Has this always been the case or did it start
with OS 4.0?

Roger Stringer
Marietta Systems, Inc.
Roger Stringer
Marietta Systems, Inc., PO Box 71506, Marietta, Georgia 30007
Phone: (770) 565-1560     FAX: (770) 565-4421
"RF-TP" and "Marietta PDE" are the trademarks of Marietta Systems, Inc.
Visit our web site for company and product information: 
        http://www.MariettaSystems.com
==================================


-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/tech/support/forums/

Reply via email to