[hackers] [scc] [libc] Fix typo in strncmp || Christopher M. Graff

From: <git_AT_suckless.org>
Date: Tue, 28 Feb 2017 20:57:52 +0100 (CET)

commit 11f3b95b620bb62279800a648d6cb9c736be78d2
Author: Christopher M. Graff <cm0graff_AT_gmail.com>
AuthorDate: Tue Feb 28 11:56:45 2017 -0600
Commit: Roberto E. Vargas Caballero <k0ga_AT_shike2.com>
CommitDate: Tue Feb 28 20:57:43 2017 +0100

    [libc] Fix typo in strncmp

diff --git a/libc/src/strncmp.c b/libc/src/strncmp.c
index 42e857b..08d0387 100644
--- a/libc/src/strncmp.c
+++ b/libc/src/strncmp.c
_AT_@ -5,7 +5,7 @@
 int
 strncmp(const char *s1, const char *s2, size_t n)
 {
- for (; n && *s1 && *s2 && *s1 != *s2; --n, ++s1, ++s2);
+ for (; n && *s1 && *s2 && *s1 == *s2; --n, ++s1, ++s2);
                 /* nothing */;
         return n ? (*(unsigned char *)s1 - *(unsigned char *)s2) : 0;
 }
Received on Tue Feb 28 2017 - 20:57:52 CET

This archive was generated by hypermail 2.3.0 : Tue Feb 28 2017 - 21:00:18 CET