From 35a0a6c02ad0f0b1ecdda0c53d0a771dcef96c08 Mon Sep 17 00:00:00 2001 From: Michihiro NAKAJIMA Date: Sun, 8 Nov 2009 14:41:53 -0500 Subject: [PATCH] - Value stored to 'err' is never read. - Value stored to 'dest' is never read. Found by Clang Static Analyzer. SVN-Revision: 1603 --- libarchive/archive_string.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/libarchive/archive_string.c b/libarchive/archive_string.c index 9b7e19948..d44499c72 100644 --- a/libarchive/archive_string.c +++ b/libarchive/archive_string.c @@ -291,12 +291,10 @@ __archive_string_utf8_w(struct archive_string *as) int wc, wc2;/* Must be large enough for a 21-bit Unicode code point. */ const char *src; int n; - int err; ws = (wchar_t *)malloc((as->length + 1) * sizeof(wchar_t)); if (ws == NULL) __archive_errx(1, "Out of memory"); - err = 0; dest = ws; src = as->s; while (*src != '\0') { @@ -344,7 +342,7 @@ __archive_string_utf8_w(struct archive_string *as) } else *dest++ = wc; } - *dest++ = L'\0'; + *dest = L'\0'; return (ws); } -- 2.47.3