git.ucc.asn.au
/
tpg
/
acess2.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
4d4fd4c
)
Fixed strncmp
author
John Hodge
<
[email protected]
>
Sun, 27 Sep 2009 10:12:46 +0000
(18:12 +0800)
committer
John Hodge
<
[email protected]
>
Sun, 27 Sep 2009 10:12:46 +0000
(18:12 +0800)
Kernel/lib.c
patch
|
blob
|
history
diff --git
a/Kernel/lib.c
b/Kernel/lib.c
index
c106351
..
3399d3d
100644
(file)
--- 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;
}
UCC
git Repository :: git.ucc.asn.au