X-Git-Url: https://arthur.barton.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=libatalk%2Funicode%2Fcharcnv.c;h=c6dd068e5ad5869f2b41f566f1ac437bf8c5909f;hb=732c8c36e8e6063ad3a3003068824428c9dc55b6;hp=797c6b752c908b2faddd2505c5c095d6f62e5cb0;hpb=66e8a44cacea32be6b669ff9ba651dba95163c8b;p=netatalk.git diff --git a/libatalk/unicode/charcnv.c b/libatalk/unicode/charcnv.c index 797c6b75..c6dd068e 100644 --- a/libatalk/unicode/charcnv.c +++ b/libatalk/unicode/charcnv.c @@ -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); }