diff options
author | Jason Evans <je@fb.com> | 2016-03-15 16:35:14 (GMT) |
---|---|---|
committer | Jason Evans <je@fb.com> | 2016-03-15 16:40:02 (GMT) |
commit | 22af74e10615ce6b6898ae38a378af27757f9e16 (patch) | |
tree | 5f42710d766f9417ce1c7cb6d6d897b59c01029d /src/util.c | |
parent | 434ea64b267e5e9e16a66ab1cccf9fab34302ff5 (diff) | |
download | jemalloc-22af74e10615ce6b6898ae38a378af27757f9e16.zip jemalloc-22af74e10615ce6b6898ae38a378af27757f9e16.tar.gz jemalloc-22af74e10615ce6b6898ae38a378af27757f9e16.tar.bz2 |
Refactor out signed/unsigned comparisons.
Diffstat (limited to 'src/util.c')
-rw-r--r-- | src/util.c | 11 |
1 files changed, 4 insertions, 7 deletions
@@ -314,10 +314,9 @@ x2s(uintmax_t x, bool alt_form, bool uppercase, char *s, size_t *slen_p) return (s); } -int +size_t malloc_vsnprintf(char *str, size_t size, const char *format, va_list ap) { - int ret; size_t i; const char *f; @@ -585,21 +584,19 @@ malloc_vsnprintf(char *str, size_t size, const char *format, va_list ap) str[i] = '\0'; else str[size - 1] = '\0'; - assert(i < INT_MAX); - ret = (int)i; #undef APPEND_C #undef APPEND_S #undef APPEND_PADDED_S #undef GET_ARG_NUMERIC - return (ret); + return (i); } JEMALLOC_FORMAT_PRINTF(3, 4) -int +size_t malloc_snprintf(char *str, size_t size, const char *format, ...) { - int ret; + size_t ret; va_list ap; va_start(ap, format); |