summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2004-08-25 07:30:58 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:58:22 -0500
commit235a71fa3e9cc1223a6000beb8c775a0cfd14b5e (patch)
treec99f212c563ae45490e2b3ac9e8318e4399948e4
parent5e869b4eabaf428b36b5bc158ab4047d25e3eb5b (diff)
downloadsamba-235a71fa3e9cc1223a6000beb8c775a0cfd14b5e.tar.gz
samba-235a71fa3e9cc1223a6000beb8c775a0cfd14b5e.tar.bz2
samba-235a71fa3e9cc1223a6000beb8c775a0cfd14b5e.zip
r2056: Allow the compiler to check this format string.
Andrew Bartlett (This used to be commit 7e18ca72854ad9801da6ffd56dc2bb804a3f52f9)
-rw-r--r--source4/torture/torture.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/source4/torture/torture.c b/source4/torture/torture.c
index 176475ff21..d59218009c 100644
--- a/source4/torture/torture.c
+++ b/source4/torture/torture.c
@@ -1831,7 +1831,7 @@ test how many open files this server supports on the one socket
*/
static BOOL run_maxfidtest(struct smbcli_state *cli, int dummy)
{
- const char *template = "\\maxfid.%d.%d";
+#define MAXFID_TEMPLATE "\\maxfid.%d.%d"
char *fname;
int fnums[0x11000], i;
int retries=4;
@@ -1845,7 +1845,7 @@ static BOOL run_maxfidtest(struct smbcli_state *cli, int dummy)
printf("Testing maximum number of open files\n");
for (i=0; i<0x11000; i++) {
- asprintf(&fname, template, i,(int)getpid());
+ asprintf(&fname, MAXFID_TEMPLATE, i,(int)getpid());
if ((fnums[i] = smbcli_open(cli->tree, fname,
O_RDWR|O_CREAT|O_TRUNC, DENY_NONE)) ==
-1) {
@@ -1862,7 +1862,7 @@ static BOOL run_maxfidtest(struct smbcli_state *cli, int dummy)
printf("cleaning up\n");
for (;i>=0;i--) {
- asprintf(&fname, template, i,(int)getpid());
+ asprintf(&fname, MAXFID_TEMPLATE, i,(int)getpid());
if (NT_STATUS_IS_ERR(smbcli_close(cli->tree, fnums[i]))) {
printf("Close of fnum %d failed - %s\n", fnums[i], smbcli_errstr(cli->tree));
}
@@ -1881,6 +1881,7 @@ static BOOL run_maxfidtest(struct smbcli_state *cli, int dummy)
correct = False;
}
return correct;
+#undef MAXFID_TEMPLATE
}
/* send smb negprot commands, not reading the response */