From: Darrick J. Wong Date: Tue, 25 Jun 2019 21:04:42 +0000 (-0400) Subject: libfrog: cvt_u64 should use strtoull, not strtoll X-Git-Tag: v5.1.0-rc1~19 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b089256c3a0a5bcd62c5e9e9d93f7e7cbac2b31e;p=thirdparty%2Fxfsprogs-dev.git libfrog: cvt_u64 should use strtoull, not strtoll cvt_u64 converts a string to an unsigned 64-bit number, so it should use strtoull, not strtoll because we don't want negative numbers here. Signed-off-by: Darrick J. Wong Reviewed-by: Eric Sandeen Reviewed-by: Christoph Hellwig Signed-off-by: Eric Sandeen --- diff --git a/libfrog/convert.c b/libfrog/convert.c index 623975075..8d4d4077b 100644 --- a/libfrog/convert.c +++ b/libfrog/convert.c @@ -105,14 +105,14 @@ cvt_s16( */ uint64_t cvt_u64( - char *s, - int base) + char *s, + int base) { - long long i; - char *sp; + unsigned long long i; + char *sp; errno = 0; - i = strtoll(s, &sp, base); + i = strtoull(s, &sp, base); /* * If the input would over or underflow, return the clamped * value and let the user check errno. If we went all the