]> git.ipfire.org Git - thirdparty/libarchive.git/commitdiff
Correctly format the value -9223372036854775808.
authorTim Kientzle <kientzle@gmail.com>
Fri, 31 Dec 2010 05:09:18 +0000 (00:09 -0500)
committerTim Kientzle <kientzle@gmail.com>
Fri, 31 Dec 2010 05:09:18 +0000 (00:09 -0500)
SVN-Revision: 2845

tar/util.c

index d5202fee9076934b1469be8dc4c533c5b2d295ca..c02bb37ac57a986009d572569a9a99e1abfe594c 100644 (file)
@@ -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;