strnlen should return size_t

PUBLISHED_FROM=545c7d80380c48332803ef00981763b130a1c1c6
This commit is contained in:
Deomid Ryabkov 2015-10-22 18:21:22 +01:00 committed by Marko Mikulicic
parent 2a4ca9d5c3
commit b97d3fea4b
2 changed files with 2 additions and 2 deletions

View File

@ -921,7 +921,7 @@ int cs_base64_decode(const unsigned char *s, int len, char *dst) {
#if !(_XOPEN_SOURCE >= 700 || _POSIX_C_SOURCE >= 200809L) && \
!(__DARWIN_C_LEVEL >= 200809L) && !defined(RTOS_SDK) || \
defined(_WIN32)
int strnlen(const char *s, size_t maxlen) {
size_t strnlen(const char *s, size_t maxlen) {
size_t l = 0;
for (; l < maxlen && s[l] != '\0'; l++) {
}

View File

@ -483,7 +483,7 @@ int c_vsnprintf(char *buf, size_t buf_size, const char *format, va_list ap);
#if !(_XOPEN_SOURCE >= 700 || _POSIX_C_SOURCE >= 200809L) && \
!(__DARWIN_C_LEVEL >= 200809L) && !defined(RTOS_SDK) || \
defined(_WIN32)
int strnlen(const char *s, size_t maxlen);
size_t strnlen(const char *s, size_t maxlen);
#endif
#ifdef __cplusplus