svn commit: samba r2056 - branches/SAMBA_4_0/source/torture

abartlet at samba.org abartlet at samba.org
Wed Aug 25 07:30:58 GMT 2004


Author: abartlet
Date: 2004-08-25 07:30:58 +0000 (Wed, 25 Aug 2004)
New Revision: 2056

WebSVN: http://websvn.samba.org/websvn/changeset.php?rep=samba&path=/&rev=2056&nolog=1

Log:
Allow the compiler to check this format string.

Andrew Bartlett

Modified:
   branches/SAMBA_4_0/source/torture/torture.c


Changeset:
Modified: branches/SAMBA_4_0/source/torture/torture.c
===================================================================
--- branches/SAMBA_4_0/source/torture/torture.c	2004-08-25 07:15:21 UTC (rev 2055)
+++ branches/SAMBA_4_0/source/torture/torture.c	2004-08-25 07:30:58 UTC (rev 2056)
@@ -1831,7 +1831,7 @@
 */
 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 @@
 	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 @@
 
 	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 @@
 		correct = False;
 	}
 	return correct;
+#undef MAXFID_TEMPLATE
 }
 
 /* send smb negprot commands, not reading the response */



More information about the samba-cvs mailing list