From 99a9b0f7c4f85f46102457cf4707e8948b77fb3f Mon Sep 17 00:00:00 2001 From: Luke Leighton Date: Mon, 8 Feb 1999 23:40:49 +0000 Subject: UNICODE byte ordering issue: typecast to uint16* replaced with SSVAL() (This used to be commit 9084b7e33dfe717bd8d5604ee71d137e3baef0f5) --- source3/lib/util_unistr.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'source3/lib/util_unistr.c') diff --git a/source3/lib/util_unistr.c b/source3/lib/util_unistr.c index c58820cfec..50bb73f4fb 100644 --- a/source3/lib/util_unistr.c +++ b/source3/lib/util_unistr.c @@ -56,7 +56,7 @@ Return a ascii version of a unicode string Hack alert: uses fixed buffer(s) and only handles ascii strings ********************************************************************/ #define MAXUNI 1024 -char *unistrn2(uint16 *buf, int len) +char *unistrn2(char *buf, int len) { static char lbufs[8][MAXUNI]; static int nexti; @@ -65,9 +65,9 @@ char *unistrn2(uint16 *buf, int len) nexti = (nexti+1)%8; - for (p = lbuf; *buf && p-lbuf < MAXUNI-2 && len > 0; len--, p++, buf++) + for (p = lbuf; *buf && p-lbuf < MAXUNI-2 && len > 0; len--, p++, buf+=2) { - *p = *buf; + SSVAL(p, 0, *buf); } *p = 0; @@ -189,7 +189,7 @@ return number of unicode chars copied, excluding the null character. only handles ascii strings ********************************************************************/ #define MAXUNI 1024 -int struni2(uint16 *p, const char *buf) +int struni2(char *p, const char *buf) { int len = 0; @@ -197,9 +197,9 @@ int struni2(uint16 *p, const char *buf) if (buf != NULL) { - for (; *buf && len < MAXUNI-2; len++, p++, buf++) + for (; *buf && len < MAXUNI-2; len++, p += 2, buf++) { - *p = *buf; + SSVAL(p, 0, *buf); } } -- cgit