]> git.ipfire.org Git - thirdparty/libarchive.git/commitdiff
- Value stored to 'err' is never read.
authorMichihiro NAKAJIMA <ggcueroad@gmail.com>
Sun, 8 Nov 2009 19:41:53 +0000 (14:41 -0500)
committerMichihiro NAKAJIMA <ggcueroad@gmail.com>
Sun, 8 Nov 2009 19:41:53 +0000 (14:41 -0500)
- Value stored to 'dest' is never read.

Found by Clang Static Analyzer.

SVN-Revision: 1603

libarchive/archive_string.c

index 9b7e19948ddb4d9e48f11791960fbfd8c4190acc..d44499c72675945999c0142da04807b6747769df 100644 (file)
@@ -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);
 }