]> rtime.felk.cvut.cz Git - jailhouse.git/commitdiff
inmates: lib: fix strncmp
authorpeter03192003@gmail.com <peter03192003@gmail.com>
Tue, 5 Apr 2016 18:01:13 +0000 (11:01 -0700)
committerJan Kiszka <jan.kiszka@siemens.com>
Thu, 7 Apr 2016 16:17:29 +0000 (09:17 -0700)
We only tested the first character of the strings so far. Make sure to
advance the pointers correctly.

Signed-off-by: ShengYen Peng <peter03192003@gmail.com>
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
inmates/lib/string.c

index a6a3874590278d9820d8ba371b6c0691e7b56b4e..781614089efee08d5b87eb4cab3d648ff85ac552 100644 (file)
@@ -41,6 +41,8 @@ int strncmp(const char *s1, const char *s2, unsigned long n)
                        return diff;
                if (*s1 == 0)
                        break;
+               s1++;
+               s2++;
        }
        return 0;
 }