Chromium Code Reviews| Index: fusl/src/string/strncmp.c |
| diff --git a/fusl/src/string/strncmp.c b/fusl/src/string/strncmp.c |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..e228843f0bb394a209b764296e1df52fc8663344 |
| --- /dev/null |
| +++ b/fusl/src/string/strncmp.c |
| @@ -0,0 +1,9 @@ |
| +#include <string.h> |
| + |
| +int strncmp(const char *_l, const char *_r, size_t n) |
| +{ |
| + const unsigned char *l=(void *)_l, *r=(void *)_r; |
| + if (!n--) return 0; |
| + for (; *l && *r && n && *l == *r ; l++, r++, n--); |
| + return *l - *r; |
| +} |