]> git.ipfire.org Git - thirdparty/libarchive.git/commitdiff
Correct a bit flag check. do not confuse SCONV_FROM_UTF16BE and SCONV_FROM_UTF16LE.
authorMichihiro NAKAJIMA <ggcueroad@gmail.com>
Sun, 27 Nov 2011 05:05:44 +0000 (00:05 -0500)
committerMichihiro NAKAJIMA <ggcueroad@gmail.com>
Sun, 27 Nov 2011 05:05:44 +0000 (00:05 -0500)
SVN-Revision: 3855

libarchive/archive_string.c

index 27b69a6623fe8189a50afce9459fc73f6b519f67..9d58cfd9e2654ab3c512dd1de22519f5b4aee685 100644 (file)
@@ -1088,9 +1088,11 @@ setup_converter(struct archive_string_conv *sc)
                }
 #endif
 
-               if (sc->flag & (SCONV_BEST_EFFORT | SCONV_FROM_UTF16BE))
+               if ((sc->flag & (SCONV_BEST_EFFORT | SCONV_FROM_UTF16BE))
+                   == (SCONV_BEST_EFFORT | SCONV_FROM_UTF16BE))
                        add_converter(sc, best_effort_strncat_from_utf16be);
-               else if (sc->flag & (SCONV_BEST_EFFORT | SCONV_FROM_UTF16LE))
+               else if ((sc->flag & (SCONV_BEST_EFFORT | SCONV_FROM_UTF16LE))
+                   == (SCONV_BEST_EFFORT | SCONV_FROM_UTF16LE))
                        add_converter(sc, best_effort_strncat_from_utf16le);
                else
                        /* Make sure we have no converter. */