svn commit: samba r10662 - in branches/SAMBA_4_0/source/torture/nbench: .

jelmer at samba.org jelmer at samba.org
Fri Sep 30 21:48:26 GMT 2005


Author: jelmer
Date: 2005-09-30 21:48:25 +0000 (Fri, 30 Sep 2005)
New Revision: 10662

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=10662

Log:
Eliminate pstring and friends.

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


Changeset:
Modified: branches/SAMBA_4_0/source/torture/nbench/nbench.c
===================================================================
--- branches/SAMBA_4_0/source/torture/nbench/nbench.c	2005-09-30 21:36:59 UTC (rev 10661)
+++ branches/SAMBA_4_0/source/torture/nbench/nbench.c	2005-09-30 21:48:25 UTC (rev 10662)
@@ -37,8 +37,7 @@
 	pstring line;
 	char *cname;
 	FILE *f;
-	fstring params[20];
-	const char *p;
+	const char **params;
 	BOOL correct = True;
 
 	if (torture_nprocs == 1) {
@@ -68,13 +67,9 @@
 
 		all_string_sub(line,"client1", cname, sizeof(line));
 		
-		p = line;
-		for (i=0; 
-		     i<19 && next_token(&p, params[i], " ", sizeof(fstring));
-		     i++) ;
+		params = str_list_make_shell(NULL, line, " ");
+		i = str_list_length(params);
 
-		params[i][0] = 0;
-
 		if (i < 2 || params[0][0] == '#') continue;
 
 		if (!strncmp(params[0],"SMB", 3)) {
@@ -84,6 +79,7 @@
 
 		if (strncmp(params[i-1], "NT_STATUS_", 10) != 0) {
 			printf("Badly formed status at line %d\n", nbench_line_count);
+			talloc_free(params);
 			continue;
 		}
 
@@ -142,6 +138,8 @@
 		} else {
 			printf("[%d] Unknown operation %s\n", nbench_line_count, params[0]);
 		}
+
+		talloc_free(params);
 		
 		if (nb_tick()) goto done;
 	}



More information about the samba-cvs mailing list