X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=Kernel%2Flib.c;h=3399d3d85ca7af8fb496117c03f09d7eb4c8e170;hb=e33d76955a6ac462062bcc47c22c774ab4423185;hp=c1063516f3256e1714cac58e58a606712b29302d;hpb=d3a46a7874a4d535d6cb9ef00c451d0bbbb65e9c;p=tpg%2Facess2.git diff --git a/Kernel/lib.c b/Kernel/lib.c index c1063516..3399d3d8 100644 --- a/Kernel/lib.c +++ b/Kernel/lib.c @@ -141,7 +141,8 @@ int strcmp(char *str1, char *str2) */ int strncmp(char *Str1, char *Str2, size_t num) { - while(num-- && *Str1 && *Str1 == *Str2) + if(num == 0) return 0; // TODO: Check what should officially happen here + while(--num && *Str1 && *Str1 == *Str2) Str1++, Str2++; return *Str1-*Str2; }