From: Michihiro NAKAJIMA Date: Mon, 9 Nov 2009 06:58:12 +0000 (-0500) Subject: - Value stored to 'pax' is never read. X-Git-Tag: v2.8.0~197 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=80d421d287aaee63eda4263b790ddc93f37cb076;p=thirdparty%2Flibarchive.git - Value stored to 'pax' is never read. - Value stored to 'p' is never read. - Value stored to 'd' is never read. Found by Clang Static Analyzer. SVN-Revision: 1618 --- diff --git a/libarchive/archive_write_set_format_pax.c b/libarchive/archive_write_set_format_pax.c index 0ff69d9c4..5791d9058 100644 --- a/libarchive/archive_write_set_format_pax.c +++ b/libarchive/archive_write_set_format_pax.c @@ -1125,7 +1125,7 @@ build_ustar_entry_name(char *dest, const char *src, size_t src_length, p += filename_end - filename; if (need_slash) *p++ = '/'; - *p++ = '\0'; + *p = '\0'; return (dest); } @@ -1216,13 +1216,11 @@ build_pax_attribute_name(char *dest, const char *src) static int archive_write_pax_finish(struct archive_write *a) { - struct pax *pax; int r; if (a->compressor.write == NULL) return (ARCHIVE_OK); - pax = (struct pax *)a->format_data; r = write_nulls(a, 512 * 2); return (r); } @@ -1388,6 +1386,6 @@ base64_encode(const char *s, size_t len) break; } /* Add trailing NUL character so output is a valid C string. */ - *d++ = '\0'; + *d = '\0'; return (out); }