]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
When traversing VG_(args_for_client) there is no need to check
authorFlorian Krohm <florian@eich-krohm.de>
Tue, 28 Oct 2014 20:28:32 +0000 (20:28 +0000)
committerFlorian Krohm <florian@eich-krohm.de>
Tue, 28 Oct 2014 20:28:32 +0000 (20:28 +0000)
the array element for NULL. Function VG_(split_up_argv), which
sets up that array, ensures that no element is NULL.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14671

cachegrind/cg_main.c
massif/ms_main.c

index 6f8cfd202ef7034b64a863552b82bf0e5484c628..b174457aeddc698f443a55f9fc82b22f63806a1b 100644 (file)
@@ -1420,10 +1420,8 @@ static void fprint_CC_table_and_calc_totals(void)
               VG_(strlen)( VG_(args_the_exename) ));
    for (i = 0; i < VG_(sizeXA)( VG_(args_for_client) ); i++) {
       HChar* arg = * (HChar**) VG_(indexXA)( VG_(args_for_client), i );
-      if (arg) {
-         VG_(write)(fd, " ", 1);
-         VG_(write)(fd, arg, VG_(strlen)( arg ));
-      }
+      VG_(write)(fd, " ", 1);
+      VG_(write)(fd, arg, VG_(strlen)( arg ));
    }
    // "events:" line
    if (clo_cache_sim && clo_branch_sim) {
index cdd73b498ee683427a21ee7cffa117f371c2bd54..4fc7d6feb0d7711b5652a7020884a756ceda7527 100644 (file)
@@ -2334,8 +2334,7 @@ static void write_snapshots_to_file(const HChar* massif_out_file,
    FP("%s", VG_(args_the_exename));
    for (i = 0; i < VG_(sizeXA)( VG_(args_for_client) ); i++) {
       HChar* arg = * (HChar**) VG_(indexXA)( VG_(args_for_client), i );
-      if (arg)
-         FP(" %s", arg);
+      FP(" %s", arg);
    }
    FP("\n");