1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-26 10:04:02 +03:00

Remove excess logging when probing for the length of the next mb char.

Jeremy.
This commit is contained in:
Jeremy Allison -
parent 234800eeb6
commit 5a2fd8e765
2 changed files with 20 additions and 13 deletions

View File

@ -1307,6 +1307,7 @@ size_t next_mb_char_size(const char *s)
if (!(*s & 0x80))
return 1; /* ascii. */
conv_silent = True;
for ( i = 1; i <=4; i++ ) {
smb_ucs2_t uc;
if (convert_string(CH_UNIX, CH_UCS2, s, i, &uc, 2, False) == 2) {
@ -1314,10 +1315,12 @@ size_t next_mb_char_size(const char *s)
DEBUG(10,("next_mb_char_size: size %u at string %s\n",
(unsigned int)i, s));
#endif
conv_silent = False;
return i;
}
}
/* We're hosed - we don't know how big this is... */
DEBUG(10,("next_mb_char_size: unknown size at string %s\n", s));
conv_silent = False;
return 1;
}

View File

@ -113,19 +113,23 @@ NTSTATUS check_path_syntax(pstring destname, const pstring srcname)
}
s++;
} else {
switch(next_mb_char_size(s)) {
case 4:
*d++ = *s++;
case 3:
*d++ = *s++;
case 2:
*d++ = *s++;
case 1:
*d++ = *s++;
break;
default:
DEBUG(0,("check_path_syntax: character length assumptions invalid !\n"));
return NT_STATUS_INVALID_PARAMETER;
if (!(*s & 0x80)) {
*d++ = *s++;
} else {
switch(next_mb_char_size(s)) {
case 4:
*d++ = *s++;
case 3:
*d++ = *s++;
case 2:
*d++ = *s++;
case 1:
*d++ = *s++;
break;
default:
DEBUG(0,("check_path_syntax: character length assumptions invalid !\n"));
return NT_STATUS_INVALID_PARAMETER;
}
}
}
}