summaryrefslogtreecommitdiffstats
path: root/source3/lib
diff options
context:
space:
mode:
authorHerb Lewis <herb@samba.org>2001-08-24 19:17:43 +0000
committerHerb Lewis <herb@samba.org>2001-08-24 19:17:43 +0000
commitbe184b26620b64af6b7114fa29f2c2b525fa1cb8 (patch)
treea35aee62302dd436682a4d98ef4020e9fce15c97 /source3/lib
parent31b6b7aecdca9086e4cbbb7ae89fd6d6ca84928d (diff)
downloadsamba-be184b26620b64af6b7114fa29f2c2b525fa1cb8.tar.gz
samba-be184b26620b64af6b7114fa29f2c2b525fa1cb8.tar.xz
samba-be184b26620b64af6b7114fa29f2c2b525fa1cb8.zip
fixes big endian unistring problems. Need to check that it didn't
break little-endian machines. (This used to be commit 0f08e79030419b778c1229712c98b839faaf734f)
Diffstat (limited to 'source3/lib')
-rw-r--r--source3/lib/util_unistr.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/source3/lib/util_unistr.c b/source3/lib/util_unistr.c
index 48bff4c41cc..d4c71ae13f9 100644
--- a/source3/lib/util_unistr.c
+++ b/source3/lib/util_unistr.c
@@ -159,6 +159,7 @@ static smb_unicode_table_t map_table2[] = {
static unsigned char map_table_flags(smb_ucs2_t v)
{
+ v = SVAL(&v,0);
if (v < TABLE1_BOUNDARY) return map_table1[v].flags;
if (v >= TABLE2_BOUNDARY) return map_table2[v - TABLE2_BOUNDARY].flags;
return 0;
@@ -166,6 +167,7 @@ static unsigned char map_table_flags(smb_ucs2_t v)
static smb_ucs2_t map_table_lower(smb_ucs2_t v)
{
+ v = SVAL(&v,0);
if (v < TABLE1_BOUNDARY) return map_table1[v].lower;
if (v >= TABLE2_BOUNDARY) return map_table2[v - TABLE2_BOUNDARY].lower;
return v;
@@ -173,6 +175,7 @@ static smb_ucs2_t map_table_lower(smb_ucs2_t v)
static smb_ucs2_t map_table_upper(smb_ucs2_t v)
{
+ v = SVAL(&v,0);
if (v < TABLE1_BOUNDARY) return map_table1[v].upper;
if (v >= TABLE2_BOUNDARY) return map_table2[v - TABLE2_BOUNDARY].upper;
return v;
@@ -202,7 +205,9 @@ int islower_w( smb_ucs2_t val)
smb_ucs2_t toupper_w( smb_ucs2_t val )
{
- return map_table_upper(val);
+ val = map_table_upper(val);
+ val = SVAL(&val,0);
+ return val;
}
/*******************************************************************
@@ -211,7 +216,9 @@ smb_ucs2_t toupper_w( smb_ucs2_t val )
smb_ucs2_t tolower_w( smb_ucs2_t val )
{
- return map_table_lower(val);
+ val = map_table_lower(val);
+ val = SVAL(&val,0);
+ return val;
}
/*******************************************************************