summaryrefslogtreecommitdiff
path: root/source3/libsmb
diff options
context:
space:
mode:
authorTim Prouty <tim.prouty@isilon.com>2008-03-03 13:32:54 -0800
committerVolker Lendecke <vl@samba.org>2008-04-11 11:33:33 +0200
commitbb869741ddc3d82da02c96bef592dab6074ff142 (patch)
tree4b8d6ca57ebd747ff80d1ccf28212bb8f63e7b4d /source3/libsmb
parent245ebca937d1a98007ad8a85fbf7cdc812ba6316 (diff)
downloadsamba-bb869741ddc3d82da02c96bef592dab6074ff142.tar.gz
samba-bb869741ddc3d82da02c96bef592dab6074ff142.tar.bz2
samba-bb869741ddc3d82da02c96bef592dab6074ff142.zip
Cleanup size_t return values in convert_string_allocate
This patch is the first iteration of an inside-out conversion to cleanup functions in charcnv.c returning size_t == -1 to indicate failure. (This used to be commit 59124382d2894a1b194b48dd82bc5f956959eb48)
Diffstat (limited to 'source3/libsmb')
-rw-r--r--source3/libsmb/climessage.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/source3/libsmb/climessage.c b/source3/libsmb/climessage.c
index 00c25aa725..808190e79c 100644
--- a/source3/libsmb/climessage.c
+++ b/source3/libsmb/climessage.c
@@ -71,7 +71,7 @@ bool cli_message_start(struct cli_state *cli, const char *host, const char *user
int cli_message_text_build(struct cli_state *cli, const char *msg, int len, int grp)
{
char *msgdos;
- int lendos;
+ size_t lendos;
char *p;
memset(cli->outbuf,'\0',smb_size);
@@ -85,7 +85,8 @@ int cli_message_text_build(struct cli_state *cli, const char *msg, int len, int
p = smb_buf(cli->outbuf);
*p++ = 1;
- if ((lendos = (int)convert_string_allocate(NULL,CH_UNIX, CH_DOS, msg,len, (void **)(void *)&msgdos, True)) < 0 || !msgdos) {
+ if (!convert_string_allocate(NULL, CH_UNIX, CH_DOS, msg, len,
+ (void **)(void *)&msgdos, &lendos, True) || !msgdos) {
DEBUG(3,("Conversion failed, sending message in UNIX charset\n"));
SSVAL(p, 0, len); p += 2;
if (len > cli->bufsize - PTR_DIFF(p,cli->outbuf)) {