]> git.ipfire.org Git - thirdparty/libarchive.git/commitdiff
- Value stored to 'ret' is never read.
authorMichihiro NAKAJIMA <ggcueroad@gmail.com>
Mon, 9 Nov 2009 06:13:29 +0000 (01:13 -0500)
committerMichihiro NAKAJIMA <ggcueroad@gmail.com>
Mon, 9 Nov 2009 06:13:29 +0000 (01:13 -0500)
- Value stored to 'cpio' is never read.
- Although the value stored to 'v' is used in the enclosing expression,
  the value is never actually read from 'v'.

Found by Clang Static Analyzer.

SVN-Revision: 1615

libarchive/archive_write_set_format_cpio_newc.c

index 06805cfd6aaef15abeb16b0b75d8d844736d377d..7230a71d32f6115676da4e89683b2f9566489986 100644 (file)
@@ -238,17 +238,15 @@ format_hex_recursive(int64_t v, char *p, int s)
                return (v);
        v = format_hex_recursive(v, p+1, s-1);
        *p = "0123456789abcdef"[v & 0xf];
-       return (v >>= 4);
+       return (v >> 4);
 }
 
 static int
 archive_write_newc_finish(struct archive_write *a)
 {
-       struct cpio *cpio;
        int er;
        struct archive_entry *trailer;
 
-       cpio = (struct cpio *)a->format_data;
        trailer = archive_entry_new();
        archive_entry_set_nlink(trailer, 1);
        archive_entry_set_pathname(trailer, "TRAILER!!!");
@@ -275,7 +273,6 @@ archive_write_newc_finish_entry(struct archive_write *a)
        int to_write, ret;
 
        cpio = (struct cpio *)a->format_data;
-       ret = ARCHIVE_OK;
        while (cpio->entry_bytes_remaining > 0) {
                to_write = cpio->entry_bytes_remaining < a->null_length ?
                    cpio->entry_bytes_remaining : a->null_length;