update
This commit is contained in:
parent
7bf09994cf
commit
ff66e2ef5d
|
@ -1,8 +1,7 @@
|
||||||
#include "myfunc.h"
|
#include "myfunc.h"
|
||||||
#include <cstring>
|
|
||||||
|
|
||||||
int strncmp(const char* s1, const char* s2, size_t n) {
|
int strncmp(const char* s1, const char* s2, int n) {
|
||||||
for (size_t i = 0; i < n; i++) {
|
for (int i = 0; i < n; i++) {
|
||||||
if (s1[i] != s2[i]) {
|
if (s1[i] != s2[i]) {
|
||||||
return (unsigned char)s1[i] - (unsigned char)s2[i];
|
return (unsigned char)s1[i] - (unsigned char)s2[i];
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue