X-Git-Url: http://git.joshuawise.com/netwatch.git/blobdiff_plain/6e6d4a8b902639de18da98519a2141ea22432700..4d8868425004956946425f8f68a0b350c3919402:/lib/minilib.c?ds=inline diff --git a/lib/minilib.c b/lib/minilib.c index c1d36b6..e90f7af 100644 --- a/lib/minilib.c +++ b/lib/minilib.c @@ -50,6 +50,16 @@ int strcmp (const char *a2, const char *a1) { } } +int strncmp (const char *a2, const char *a1, int n) { + while (n--) { + if (*a2 != *a1) return 1; + if (*a2 == 0) return 0; + a1++; + a2++; + } + return 0; +} + int strlen(const char *c) { int l = 0;