summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorXavier Roche <xroche@users.noreply.github.com>2014-05-17 13:55:17 +0000
committerXavier Roche <xroche@users.noreply.github.com>2014-05-17 13:55:17 +0000
commit66c8cc32aa6f8b385b8d7c3871e83df79e2a5d66 (patch)
tree579f89dd48c3b3dc3ff82dd202bf646a9d029542 /src
parent2209c7bdd8e02fee38ed1d4e5c10dd32e0ce196f (diff)
Illegal use of strnlen(..., (size_t) -1)
Diffstat (limited to 'src')
-rw-r--r--src/htssafe.h3
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;
}