From: Tim Kientzle Date: Fri, 31 Dec 2010 05:09:18 +0000 (-0500) Subject: Correctly format the value -9223372036854775808. X-Git-Tag: v3.0.0a~801 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a7b900bd075c8bf5bb6904610c82a4db921f62ed;p=thirdparty%2Flibarchive.git Correctly format the value -9223372036854775808. SVN-Revision: 2845 --- diff --git a/tar/util.c b/tar/util.c index d5202fee9..c02bb37ac 100644 --- a/tar/util.c +++ b/tar/util.c @@ -503,14 +503,13 @@ const char * tar_i64toa(int64_t n0) { static char buff[24]; - int64_t n = n0 < 0 ? -n0 : n0; + uint64_t n = n0 < 0 ? -n0 : n0; char *p = buff + sizeof(buff); *--p = '\0'; do { *--p = '0' + (int)(n % 10); - n /= 10; - } while (n > 0); + } while (n /= 10); if (n0 < 0) *--p = '-'; return p;