]> arthur.barton.de Git - netatalk.git/blobdiff - libatalk/unicode/charcnv.c
unicode endian fixes
[netatalk.git] / libatalk / unicode / charcnv.c
index 797c6b752c908b2faddd2505c5c095d6f62e5cb0..c6dd068e5ad5869f2b41f566f1ac437bf8c5909f 100644 (file)
@@ -116,7 +116,7 @@ static const char *charset_name(charset_t ch)
                ret = ln;
        }
 #else /* system doesn't have LOCALE support */
-ret = NULL;
+if (ch == CH_UNIX) ret = NULL;
 #endif
 
        if (!ret || !*ret) ret = "ASCII";
@@ -423,12 +423,12 @@ convert:
 
        /* Terminate the string */
        if (to == CH_UCS2 && destlen-o_len >= 2) {
-               *(++outbuf) = 0;
-               *outbuf = 0;
+               ob[destlen] = 0;
+               ob[destlen+1] = 0;
                *dest = (char *)realloc(ob,destlen+2);
        }
        else if ( destlen-o_len > 0) {
-               *(++outbuf) = 0;
+               ob[destlen] = 0;
                *dest = (char *)realloc(ob,destlen+1);
        }