From e6ea3cc46313a53eaac6bf789f00a91bc02f7a3f Mon Sep 17 00:00:00 2001 From: Matthew Chapman Date: Thu, 8 Apr 1999 05:34:11 +0000 Subject: Fix for endianness problem reported by Edan Idzerda . A BUFFER2 is really a "unibuf" in my terminology and we should treat it as such. (This used to be commit 7ef76320b79b3ca4e04dcf809ac6388b6c47a3d8) --- source3/lib/util_unistr.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/source3/lib/util_unistr.c b/source3/lib/util_unistr.c index 01ec262f60..4e7872021b 100644 --- a/source3/lib/util_unistr.c +++ b/source3/lib/util_unistr.c @@ -203,7 +203,7 @@ uint32 buffer2_to_uint32(const BUFFER2 *str) { if (str->buf_len == 4) { - const char *src = (const char*)str->buffer; + const char *src = str->buffer; return IVAL(src, 0); } else @@ -220,7 +220,7 @@ uint32 buffer2_to_uint32(const BUFFER2 *str) void buffer2_to_multistr(char *dest, const BUFFER2 *str, int maxlen) { char *destend; - const uint16 *src; + const char *src; int len; register uint16 c; @@ -232,6 +232,7 @@ void buffer2_to_multistr(char *dest, const BUFFER2 *str, int maxlen) { c = *(src++); *(dest++) = (c == 0) ? ' ' : (char)c; + src++; } *dest = 0; -- cgit