summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2004-03-17 19:23:44 +0000
committerJeremy Allison <jra@samba.org>2004-03-17 19:23:44 +0000
commit8868cf6a833d114f40a5e69f2dc4f94399c05b95 (patch)
treea84b853390f832020d82704a17ace6a706890fd4
parentf6984bd0731d78a9777b54626ebd502480577878 (diff)
downloadsamba-8868cf6a833d114f40a5e69f2dc4f94399c05b95.tar.gz
samba-8868cf6a833d114f40a5e69f2dc4f94399c05b95.tar.bz2
samba-8868cf6a833d114f40a5e69f2dc4f94399c05b95.zip
Remove excess logging when probing for the length of the next mb char.
Jeremy. (This used to be commit 5a2fd8e76587a572cdb97fa87a99cda3e450ce0e)
-rw-r--r--source3/lib/charcnv.c3
-rw-r--r--source3/smbd/reply.c30
2 files changed, 20 insertions, 13 deletions
diff --git a/source3/lib/charcnv.c b/source3/lib/charcnv.c
index ad15788b84..f6028bb134 100644
--- a/source3/lib/charcnv.c
+++ b/source3/lib/charcnv.c
@@ -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;
}
diff --git a/source3/smbd/reply.c b/source3/smbd/reply.c
index 0fe73cddc2..f5c4f25e40 100644
--- a/source3/smbd/reply.c
+++ b/source3/smbd/reply.c
@@ -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;
+ }
}
}
}