diff options
Diffstat (limited to 'source4/torture/basic')
-rw-r--r-- | source4/torture/basic/charset.c | 5 | ||||
-rw-r--r-- | source4/torture/basic/utable.c | 13 |
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; } |