s3-auth-charcnv: fix push_string(). Don't push to ucs2 and ascii after another.
[ira/wip.git] / source3 / lib / charcnv.c
index eb794d8347f21a967ec936527a5545c95289c8e4..b94566863c51e45ef8b34d95b9150df6396c9a06 100644 (file)
@@ -1672,8 +1672,9 @@ ssize_t push_string(void *dest, const char *src, size_t dest_len, int flags)
        if (!(flags & STR_ASCII) && \
            (flags & STR_UNICODE)) {
                ret = push_ucs2(NULL, dest, src, dest_len, flags);
+       } else {
+               ret = push_ascii(dest, src, dest_len, flags);
        }
-       ret = push_ascii(dest, src, dest_len, flags);
        if (ret == (size_t)-1) {
                return -1;
        }