diff options
author | Xavier Roche <xroche@users.noreply.github.com> | 2014-08-27 18:22:56 +0000 |
---|---|---|
committer | Xavier Roche <xroche@users.noreply.github.com> | 2014-08-27 18:22:56 +0000 |
commit | d5d752a1db8ad216db2fe018012d757c080a5927 (patch) | |
tree | f59097ac097a98a8c4d67f8c6a5f61584692534c /src/htssafe.h | |
parent | f25d6c1f24e7dcb9d881c820fe5d269259890ace (diff) |
Fixed HAVE_STRNLEN (sheesh, we don't have strnlen.o)
Diffstat (limited to 'src/htssafe.h')
-rw-r--r-- | src/htssafe.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/htssafe.h b/src/htssafe.h index 6dbba56..803534d 100644 --- a/src/htssafe.h +++ b/src/htssafe.h @@ -176,11 +176,13 @@ static HTS_UNUSED void htssafe_compile_time_check_(void) { "overflow while copying '" #B "' to '"#A"'", __FILE__, __LINE__) /** strnlen replacement (autotools). **/ -static HTS_UNUSED size_t rpl_strnlen(const char *s, size_t maxlen) { +#if ( ! defined(WIN32) && ! defined(HAVE_STRNLEN) ) +static HTS_UNUSED size_t strnlen(const char *s, size_t maxlen) { size_t i; for(i = 0 ; i < maxlen && s[i] != '\0' ; i++) ; return i; } +#endif static HTS_INLINE HTS_UNUSED size_t strlen_safe_(const char *source, const size_t sizeof_source, const char *file, int line) { |