From: Michihiro NAKAJIMA Date: Mon, 9 Nov 2009 06:13:29 +0000 (-0500) Subject: - Value stored to 'ret' is never read. X-Git-Tag: v2.8.0~200 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=f90a98eec82ee0dd2397d0c40174ba372a6d2bdc;p=thirdparty%2Flibarchive.git - Value stored to 'ret' is never read. - 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 --- diff --git a/libarchive/archive_write_set_format_cpio_newc.c b/libarchive/archive_write_set_format_cpio_newc.c index 06805cfd6..7230a71d3 100644 --- a/libarchive/archive_write_set_format_cpio_newc.c +++ b/libarchive/archive_write_set_format_cpio_newc.c @@ -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;