| 35 | #include <sys/libkern.h> |
| 36 | |
| 37 | int |
| 38 | strncmp(const char *s1, const char *s2, size_t n) |
| 39 | { |
| 40 | |
| 41 | if (n == 0) |
| 42 | return (0); |
| 43 | do { |
| 44 | if (*s1 != *s2++) |
| 45 | return (*(const unsigned char *)s1 - |
| 46 | *(const unsigned char *)(s2 - 1)); |
| 47 | if (*s1++ == '\0') |
| 48 | break; |
| 49 | } while (--n != 0); |
| 50 | return (0); |
| 51 | } |
no outgoing calls