diff options
Diffstat (limited to 'payloads')
-rw-r--r-- | payloads/libpayload/include/libpayload.h | 6 | ||||
-rw-r--r-- | payloads/libpayload/libc/string.c | 6 |
2 files changed, 6 insertions, 6 deletions
diff --git a/payloads/libpayload/include/libpayload.h b/payloads/libpayload/include/libpayload.h index b58632a42f..0757740eaf 100644 --- a/payloads/libpayload/include/libpayload.h +++ b/payloads/libpayload/include/libpayload.h @@ -214,10 +214,10 @@ u8 *sha1(const u8 *data, size_t len, u8 *buf); size_t strnlen(const char *str, size_t maxlen); size_t strlen(const char *str); int strcmp(const char *s1, const char *s2); -int strncmp(const char *s1, const char *s2, int maxlen); -char *strncpy(char *d, const char *s, int n); +int strncmp(const char *s1, const char *s2, size_t maxlen); +char *strncpy(char *d, const char *s, size_t n); char *strcpy(char *d, const char *s); -char *strncat(char *d, const char *s, int n); +char *strncat(char *d, const char *s, size_t n); char *strchr(const char *s, int c); char *strdup(const char *s); char *strstr(const char *h, const char *n); diff --git a/payloads/libpayload/libc/string.c b/payloads/libpayload/libc/string.c index e86f2c924a..85315b13ea 100644 --- a/payloads/libpayload/libc/string.c +++ b/payloads/libpayload/libc/string.c @@ -116,7 +116,7 @@ int strcmp(const char *s1, const char *s2) * @param maxlen Return at most maxlen characters as length of the string. * @return A non-zero value if s1 and s2 differ, or zero if s1 equals s2. */ -int strncmp(const char *s1, const char *s2, int maxlen) +int strncmp(const char *s1, const char *s2, size_t maxlen) { int i; @@ -128,7 +128,7 @@ int strncmp(const char *s1, const char *s2, int maxlen) return 0; } -char *strncpy(char *d, const char *s, int n) +char *strncpy(char *d, const char *s, size_t n) { /* Use +1 to get the NUL terminator. */ int max = n > strlen(s) + 1 ? strlen(s) + 1 : n; @@ -145,7 +145,7 @@ char *strcpy(char *d, const char *s) return strncpy(d, s, strlen(s) + 1); } -char *strncat(char *d, const char *s, int n) +char *strncat(char *d, const char *s, size_t n) { char *p = d + strlen(d); int max = n > strlen(s) ? strlen(s) : n; |