diff options
author | Luke Leighton <lkcl@samba.org> | 1999-02-11 22:12:49 +0000 |
---|---|---|
committer | Luke Leighton <lkcl@samba.org> | 1999-02-11 22:12:49 +0000 |
commit | f38bfc7d9aa07c4e21448aa846956bd89a259a65 (patch) | |
tree | d603b9188ac759d67877f8867a3f69c2ab425ef1 /source3/lib | |
parent | c6d16eea4394ff1c4d12cb435eebb0686b5ee736 (diff) | |
download | samba-f38bfc7d9aa07c4e21448aa846956bd89a259a65.tar.gz samba-f38bfc7d9aa07c4e21448aa846956bd89a259a65.tar.bz2 samba-f38bfc7d9aa07c4e21448aa846956bd89a259a65.zip |
UNICODE issues.
(This used to be commit 6a437cfb33f24913e0c1f8484c0b08ef317e513b)
Diffstat (limited to 'source3/lib')
-rw-r--r-- | source3/lib/util_unistr.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/source3/lib/util_unistr.c b/source3/lib/util_unistr.c index 641f891f83..2e908cbd7a 100644 --- a/source3/lib/util_unistr.c +++ b/source3/lib/util_unistr.c @@ -62,7 +62,7 @@ Return a ascii version of a little-endian unicode string. Hack alert: uses fixed buffer(s) and only handles ascii strings ********************************************************************/ -char *unistrn2(uint16 *src, int len) +char *unistrn2(char *src, int len) { static char lbufs[8][MAXUNI]; static int nexti; @@ -71,9 +71,9 @@ char *unistrn2(uint16 *src, int len) nexti = (nexti+1)%8; - for (p = lbuf; *src && p-lbuf < MAXUNI-2 && len > 0; len--, src++) + for (p = lbuf; *src && p-lbuf < MAXUNI-2 && len > 0; len--, src += 2) { - *p++ = (*src & 0xff); + *p++ = SVAL(src, 0) & 0xFF; } *p = 0; @@ -88,16 +88,16 @@ Return a ascii version of a little-endian unicode string. Hack alert: uses fixed buffer(s) and only handles ascii strings ********************************************************************/ -char *unistr2(uint16 *src) +char *unistr2(char *src) { char *lbuf = lbufs[nexti]; char *p; nexti = (nexti+1)%8; - for (p = lbuf; *src && p-lbuf < MAXUNI-2; p++, src++) + for (p = lbuf; *src && p-lbuf < MAXUNI-2; p++, src += 2) { - *p = (*src & 0xff); + *p = SVAL(src, 0) & 0xFF; } *p = 0; @@ -260,7 +260,7 @@ char *unistr(char *buf) for (p = lbuf; *buf && p-lbuf < MAXUNI-2; p++, buf += 2) { - *p = *buf; + *p = SVAL(buf, 0) & 0xFF; } *p = 0; return lbuf; |