]> git.ipfire.org Git - thirdparty/libarchive.git/commitdiff
Fix util.c compile, remove extraneous NULL check.
authorTim Kientzle <kientzle@acm.org>
Sat, 1 Dec 2012 05:48:48 +0000 (21:48 -0800)
committerTim Kientzle <kientzle@acm.org>
Sat, 1 Dec 2012 05:48:48 +0000 (21:48 -0800)
tar/util.c

index 34b62718b9609c975c2cd73b4338359a08a02986..e311094eb7ed53af34b7c6f7d20051c0d6a997dd 100644 (file)
@@ -123,7 +123,7 @@ safe_fprintf(FILE *f, const char *fmt, ...)
                else if (fmtbuff_length < 1000000)
                        fmtbuff_length += fmtbuff_length / 4;
                else {
-                       length = old_length;
+                       length = fmtbuff_length;
                        fmtbuff_heap[length-1] = '\0';
                        break;
                }
@@ -191,8 +191,7 @@ safe_fprintf(FILE *f, const char *fmt, ...)
        fprintf(f, "%s", outbuff);
 
        /* If we allocated a heap-based formatting buffer, free it now. */
-       if (fmtbuff_heap != NULL)
-               free(fmtbuff_heap);
+       free(fmtbuff_heap);
 }
 
 /*