r10662: Eliminate pstring and friends.
authorJelmer Vernooij <jelmer@samba.org>
Fri, 30 Sep 2005 21:48:25 +0000 (21:48 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 18:39:15 +0000 (13:39 -0500)
(This used to be commit ecef1ee6cd0bdae2fcbff3f57edaa26eb72f3481)

source4/torture/nbench/nbench.c

index 9b3c9cdb5ac4120e8bbbcf140d5ee77ce77cbd68..74bfe3e57a64fe79e8f4b2c39988ae0b1f555457 100644 (file)
@@ -37,8 +37,7 @@ static BOOL run_netbench(struct smbcli_state *cli, int client)
        pstring line;
        char *cname;
        FILE *f;
-       fstring params[20];
-       const char *p;
+       const char **params;
        BOOL correct = True;
 
        if (torture_nprocs == 1) {
@@ -68,12 +67,8 @@ again:
 
                all_string_sub(line,"client1", cname, sizeof(line));
                
-               p = line;
-               for (i=0; 
-                    i<19 && next_token(&p, params[i], " ", sizeof(fstring));
-                    i++) ;
-
-               params[i][0] = 0;
+               params = str_list_make_shell(NULL, line, " ");
+               i = str_list_length(params);
 
                if (i < 2 || params[0][0] == '#') continue;
 
@@ -84,6 +79,7 @@ again:
 
                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 @@ again:
                } else {
                        printf("[%d] Unknown operation %s\n", nbench_line_count, params[0]);
                }
+
+               talloc_free(params);
                
                if (nb_tick()) goto done;
        }