This is the mail archive of the libc-help@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Return values of strcmp


Hello,

I am writing a tiny implementation of glibc in asm x86 and I have a
question about return values of strcmp.

FreeBSD manpages tells us this:
RETURN VALUES
     The strcmp() and strncmp() return an integer greater than, equal to, or
     less than 0, according as the string s1 is greater than, equal to, or
     less than the string s2.

My implementation returns, -1, 0 or 1.
My question is simple: Is this an acceptable solution ?

P.S.: It technically works (Firefox, xeyes, etc...) but I am wondering
if it corresponds to what strcmp has been originally created for.

Thank you,
-- 
Arnaud Granal


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]