summaryrefslogtreecommitdiff
path: root/source4/torture/basic
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2009-03-01 19:55:46 +0100
committerJelmer Vernooij <jelmer@samba.org>2009-03-01 19:55:46 +0100
commit94069bd2747a8397308c0b0b384f7bb4edd8f68b (patch)
treeace3c4fa9d0cb134d4e904354bd33b395c1e1289 /source4/torture/basic
parentbbe2d30f66ebd8537203870b1225179f03d42744 (diff)
downloadsamba-94069bd2747a8397308c0b0b384f7bb4edd8f68b.tar.gz
samba-94069bd2747a8397308c0b0b384f7bb4edd8f68b.tar.bz2
samba-94069bd2747a8397308c0b0b384f7bb4edd8f68b.zip
s4: Use same function signature for convert_* as s3.
Diffstat (limited to 'source4/torture/basic')
-rw-r--r--source4/torture/basic/charset.c5
-rw-r--r--source4/torture/basic/utable.c13
2 files changed, 9 insertions, 9 deletions
diff --git a/source4/torture/basic/charset.c b/source4/torture/basic/charset.c
index 33ab2c9768..5ac299dbbe 100644
--- a/source4/torture/basic/charset.c
+++ b/source4/torture/basic/charset.c
@@ -42,7 +42,7 @@ static NTSTATUS unicode_open(struct torture_context *tctx,
{
union smb_open io;
char *fname, *fname2=NULL, *ucs_name;
- int i;
+ size_t i;
NTSTATUS status;
ucs_name = talloc_size(mem_ctx, (1+u_name_len)*2);
@@ -56,8 +56,7 @@ static NTSTATUS unicode_open(struct torture_context *tctx,
}
SSVAL(ucs_name, i*2, 0);
- i = convert_string_talloc_convenience(ucs_name, lp_iconv_convenience(tctx->lp_ctx), CH_UTF16, CH_UNIX, ucs_name, (1+u_name_len)*2, (void **)&fname, false);
- if (i == -1) {
+ if (!convert_string_talloc_convenience(ucs_name, lp_iconv_convenience(tctx->lp_ctx), CH_UTF16, CH_UNIX, ucs_name, (1+u_name_len)*2, (void **)&fname, &i, false)) {
torture_comment(tctx, "Failed to convert UCS2 Name into unix - convert_string_talloc() failure\n");
talloc_free(ucs_name);
return NT_STATUS_NO_MEMORY;
diff --git a/source4/torture/basic/utable.c b/source4/torture/basic/utable.c
index ef0e4d44ed..ca6c2fd576 100644
--- a/source4/torture/basic/utable.c
+++ b/source4/torture/basic/utable.c
@@ -32,7 +32,8 @@ bool torture_utable(struct torture_context *tctx,
const char *alt_name;
int fnum;
uint8_t c2[4];
- int c, len, fd;
+ int c, fd;
+ size_t len;
int chars_allowed=0, alt_allowed=0;
uint8_t valid[0x10000];
@@ -49,9 +50,9 @@ bool torture_utable(struct torture_context *tctx,
SSVAL(c2, 0, c);
strncpy(fname, "\\utable\\x", sizeof(fname)-1);
p = fname+strlen(fname);
- len = convert_string_convenience(lp_iconv_convenience(tctx->lp_ctx), CH_UTF16, CH_UNIX,
+ convert_string_convenience(lp_iconv_convenience(tctx->lp_ctx), CH_UTF16, CH_UNIX,
c2, 2,
- p, sizeof(fname)-strlen(fname), false);
+ p, sizeof(fname)-strlen(fname), &len, false);
p[len] = 0;
strncat(fname,"_a_long_extension",sizeof(fname)-1);
@@ -102,15 +103,15 @@ static char *form_name(struct smb_iconv_convenience *iconv_convenience, int c)
static char fname[256];
uint8_t c2[4];
char *p;
- int len;
+ size_t len;
strncpy(fname, "\\utable\\", sizeof(fname)-1);
p = fname+strlen(fname);
SSVAL(c2, 0, c);
- len = convert_string_convenience(iconv_convenience, CH_UTF16, CH_UNIX,
+ convert_string_convenience(iconv_convenience, CH_UTF16, CH_UNIX,
c2, 2,
- p, sizeof(fname)-strlen(fname), false);
+ p, sizeof(fname)-strlen(fname), &len, false);
p[len] = 0;
return fname;
}