]> git.ipfire.org Git - thirdparty/libarchive.git/commitdiff
Continue a string conversion even if the normalization failed.
authorMichihiro NAKAJIMA <ggcueroad@gmail.com>
Tue, 10 May 2011 07:28:50 +0000 (03:28 -0400)
committerMichihiro NAKAJIMA <ggcueroad@gmail.com>
Tue, 10 May 2011 07:28:50 +0000 (03:28 -0400)
SVN-Revision: 3290

libarchive/archive_string.c

index 4fe0b004b6dbf43620553f25bf66af53f0ea7d04..151be69743a59f1a14e5b8aa8cf3caffb9424f98 100644 (file)
@@ -1558,10 +1558,12 @@ archive_strncat_in_locale(struct archive_string *as, const void *_p, size_t n,
         */
        if (sc->flag & SCONV_NORMALIZATION_C) {
                archive_string_empty(&(sc->utf8));
-               if (archive_string_normalize_C(&(sc->utf8), _p, length) != 0)
-                       return (-1);
-               src = sc->utf8.s;
-               length = sc->utf8.length;
+               if (archive_string_normalize_C(&(sc->utf8), _p, length) != 0) {
+                       return_value = -1; /* failure */
+               } else {
+                       src = sc->utf8.s;
+                       length = sc->utf8.length;
+               }
        }
 
        archive_string_ensure(as, as->length + length*2+1);