diff options
author | Xavier Roche <xroche@users.noreply.github.com> | 2014-05-17 13:55:17 +0000 |
---|---|---|
committer | Xavier Roche <xroche@users.noreply.github.com> | 2014-05-17 13:55:17 +0000 |
commit | 66c8cc32aa6f8b385b8d7c3871e83df79e2a5d66 (patch) | |
tree | 579f89dd48c3b3dc3ff82dd202bf646a9d029542 /src/htssafe.h | |
parent | 2209c7bdd8e02fee38ed1d4e5c10dd32e0ce196f (diff) |
Illegal use of strnlen(..., (size_t) -1)
Diffstat (limited to 'src/htssafe.h')
-rw-r--r-- | src/htssafe.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/htssafe.h b/src/htssafe.h index 408d661..57013fb 100644 --- a/src/htssafe.h +++ b/src/htssafe.h @@ -156,7 +156,8 @@ static HTS_INLINE HTS_UNUSED size_t strlen_safe_(const char *source, const size_ const char *file, int line) { size_t size; assertf_( source != NULL, file, line ); - size = strnlen(source, sizeof_source); + size = sizeof_source != (size_t) -1 + ? strnlen(source, sizeof_source) : strlen(source); assertf_( size < sizeof_source, file, line ); return size; } |