]> arthur.barton.de Git - netatalk.git/blobdiff - libatalk/unicode/charcnv.c
make sure we return the right length in pre/decompose
[netatalk.git] / libatalk / unicode / charcnv.c
index dabbebd91bb3031a89f7875adca11423b6f84af4..43b240dc344edba974031abdbb4fb9d9b9076bfd 100644 (file)
@@ -951,6 +951,9 @@ size_t convert_charset ( charset_t from_set, charset_t to_set, charset_t cap_cha
                return (size_t) -1;
        }
 
+       if ( o_len == 0)
+               return o_len;
+
        /* Do pre/decomposition */
        if (CHECK_FLAGS(flags, CONV_PRECOMPOSE) || 
                ((!(charsets[to_set])   || !(charsets[to_set]->flags & CHARSET_DECOMPOSED)) &&