diff options
author | Luke Leighton <lkcl@samba.org> | 1999-02-08 23:40:49 +0000 |
---|---|---|
committer | Luke Leighton <lkcl@samba.org> | 1999-02-08 23:40:49 +0000 |
commit | 99a9b0f7c4f85f46102457cf4707e8948b77fb3f (patch) | |
tree | 3bb95603cd8656e486e62ce557d368e0766b1ace /source3/lib | |
parent | 37c9693fc8055773812ed86d91f9dfcc554eea30 (diff) | |
download | samba-99a9b0f7c4f85f46102457cf4707e8948b77fb3f.tar.gz samba-99a9b0f7c4f85f46102457cf4707e8948b77fb3f.tar.bz2 samba-99a9b0f7c4f85f46102457cf4707e8948b77fb3f.zip |
UNICODE byte ordering issue: typecast to uint16* replaced with SSVAL()
(This used to be commit 9084b7e33dfe717bd8d5604ee71d137e3baef0f5)
Diffstat (limited to 'source3/lib')
-rw-r--r-- | source3/lib/util_unistr.c | 12 |
1 files changed, 6 insertions, 6 deletions
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); } } |