[libc] Fix strcmp()/strncmp() to return proper values
authorAaron Young <Aaron.Young@oracle.com>
Wed, 9 Jan 2019 19:35:39 +0000 (11:35 -0800)
committerMichael Brown <mcb30@ipxe.org>
Tue, 15 Jan 2019 14:12:27 +0000 (14:12 +0000)
commit3946aa9bac1b4a784924fab1693bfebfdd357438
treef3d76d225d0f7b16ad5a530c511a125714683bb7
parente226fecd1b602ece7f4f208042f3e87ca540b297
[libc] Fix strcmp()/strncmp() to return proper values

Fix strcmp() and strncmp() to return proper standard positive/negative
values for unequal strings.  Current implementation is backwards
(i.e. the functions are returning negative when should be positive and
vice-versa).

Currently all consumers of these functions only check the return value
for ==0 or !=0 and so we can safely change the implementation without
breaking things.

Signed-off-by: Aaron Young <Aaron.Young@oracle.com>
Modified-by: Michael Brown <mcb30@ipxe.org>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
src/core/string.c
src/tests/string_test.c