diff options
author | Gerald Carter <jerry@samba.org> | 2007-02-28 14:35:26 +0000 |
---|---|---|
committer | Gerald Carter <jerry@samba.org> | 2007-02-28 14:35:26 +0000 |
commit | 80236f0d60ce013134c1ed5422d148e541f70a4f (patch) | |
tree | f71326fa71c0323e6b5d87b75b289d0608480f87 /source/lib/util_unistr.c | |
parent | f05f5dce39b11e937fb19270b7bcc888582edf35 (diff) | |
download | samba-80236f0d60ce013134c1ed5422d148e541f70a4f.tar.gz samba-80236f0d60ce013134c1ed5422d148e541f70a4f.tar.xz samba-80236f0d60ce013134c1ed5422d148e541f70a4f.zip |
r21585: Start syncing the monster that will become 3.0.25pre1
Still todo:
* release notes
* few minor outstanding patches
* additional idmap man pages
Diffstat (limited to 'source/lib/util_unistr.c')
-rw-r--r-- | source/lib/util_unistr.c | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/source/lib/util_unistr.c b/source/lib/util_unistr.c index a0015c265fb..cf040a2dfc0 100644 --- a/source/lib/util_unistr.c +++ b/source/lib/util_unistr.c @@ -88,10 +88,12 @@ void load_case_tables(void) } initialised = 1; - upcase_table = map_file(lib_path("upcase.dat"), 0x20000); + upcase_table = (smb_ucs2_t *)map_file(lib_path("upcase.dat"), + 0x20000); upcase_table_use_unmap = ( upcase_table != NULL ); - lowcase_table = map_file(lib_path("lowcase.dat"), 0x20000); + lowcase_table = (smb_ucs2_t *)map_file(lib_path("lowcase.dat"), + 0x20000); lowcase_table_use_unmap = ( lowcase_table != NULL ); #ifdef HAVE_SETLOCALE @@ -111,7 +113,7 @@ void load_case_tables(void) not available */ if (!upcase_table) { DEBUG(1,("creating lame upcase table\n")); - upcase_table = SMB_MALLOC(0x20000); + upcase_table = (smb_ucs2_t *)SMB_MALLOC(0x20000); for (i=0;i<0x10000;i++) { smb_ucs2_t v; SSVAL(&v, 0, i); @@ -126,7 +128,7 @@ void load_case_tables(void) if (!lowcase_table) { DEBUG(1,("creating lame lowcase table\n")); - lowcase_table = SMB_MALLOC(0x20000); + lowcase_table = (smb_ucs2_t *)SMB_MALLOC(0x20000); for (i=0;i<0x10000;i++) { smb_ucs2_t v; SSVAL(&v, 0, i); @@ -169,11 +171,11 @@ static int check_dos_char_slowly(smb_ucs2_t c) smb_ucs2_t c2 = 0; int len1, len2; - len1 = convert_string(CH_UCS2, CH_DOS, &c, 2, buf, sizeof(buf),False); + len1 = convert_string(CH_UTF16LE, CH_DOS, &c, 2, buf, sizeof(buf),False); if (len1 == 0) { return 0; } - len2 = convert_string(CH_DOS, CH_UCS2, buf, len1, &c2, 2,False); + len2 = convert_string(CH_DOS, CH_UTF16LE, buf, len1, &c2, 2,False); if (len2 != 2) { return 0; } @@ -228,7 +230,7 @@ void init_valid_table(void) return; } - valid_file = map_file(lib_path("valid.dat"), 0x10000); + valid_file = (uint8 *)map_file(lib_path("valid.dat"), 0x10000); if (valid_file) { valid_table = valid_file; mapped_file = 1; @@ -247,7 +249,7 @@ void init_valid_table(void) valid_table_use_unmap = False; DEBUG(2,("creating default valid table\n")); - valid_table = SMB_MALLOC(0x10000); + valid_table = (uint8 *)SMB_MALLOC(0x10000); for (i=0;i<128;i++) { valid_table[i] = isalnum(i) || strchr(allowed,i); } @@ -482,7 +484,7 @@ size_t strnlen_w(const smb_ucs2_t *src, size_t max) size_t len; smb_ucs2_t c; - for(len = 0; *(COPY_UCS2_CHAR(&c,src)) && (len < max); src++, len++) { + for(len = 0; (len < max) && *(COPY_UCS2_CHAR(&c,src)); src++, len++) { ; } |