diff options
author | David Goulet <dgoulet@torproject.org> | 2019-07-29 12:02:47 -0400 |
---|---|---|
committer | David Goulet <dgoulet@torproject.org> | 2019-07-29 12:02:47 -0400 |
commit | 1d6054f75065214c55d17796cf1587692fbb5cea (patch) | |
tree | a70c179683f96a75d954ff98f8e3ec2c2c9a6b84 /src/lib/string | |
parent | d8264ab62b47dadae0057eb372480744c9dfdba1 (diff) | |
parent | 8bbec36b3b2dadbd23c7b3ffe2bccb7291aee1f0 (diff) | |
download | tor-1d6054f75065214c55d17796cf1587692fbb5cea.tar.gz tor-1d6054f75065214c55d17796cf1587692fbb5cea.zip |
Merge branch 'tor-github/pr/1179' into maint-0.4.1
Diffstat (limited to 'src/lib/string')
-rw-r--r-- | src/lib/string/printf.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/lib/string/printf.c b/src/lib/string/printf.c index a5cb71ce09..26203932e4 100644 --- a/src/lib/string/printf.c +++ b/src/lib/string/printf.c @@ -117,8 +117,8 @@ tor_vasprintf(char **strp, const char *fmt, va_list args) *strp = NULL; return -1; } - strp_tmp = tor_malloc(len + 1); - r = _vsnprintf(strp_tmp, len+1, fmt, args); + strp_tmp = tor_malloc((size_t)len + 1); + r = _vsnprintf(strp_tmp, (size_t)len+1, fmt, args); if (r != len) { tor_free(strp_tmp); *strp = NULL; @@ -153,9 +153,9 @@ tor_vasprintf(char **strp, const char *fmt, va_list args) *strp = tor_strdup(buf); return len; } - strp_tmp = tor_malloc(len+1); + strp_tmp = tor_malloc((size_t)len+1); /* use of tor_vsnprintf() will ensure string is null terminated */ - r = tor_vsnprintf(strp_tmp, len+1, fmt, args); + r = tor_vsnprintf(strp_tmp, (size_t)len+1, fmt, args); if (r != len) { tor_free(strp_tmp); *strp = NULL; |