]> granicus.if.org Git - sudo/commitdiff
Avoid division by zero if there was no test data.
authorTodd C. Miller <Todd.Miller@courtesan.com>
Wed, 3 Sep 2014 16:29:46 +0000 (10:29 -0600)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Wed, 3 Sep 2014 16:29:46 +0000 (10:29 -0600)
plugins/sudoers/regress/parser/check_addr.c

index 8c2a287ddc242e69d5c4ec65819f2c9e188f03a3..fd07124d83aeb1cd9aa3afd45855d8fa13079caa 100644 (file)
@@ -141,8 +141,10 @@ main(int argc, char *argv[])
        }
     }
 
-    printf("check_addr: %d tests run, %d errors, %d%% success rate\n",
-       ntests, errors, (ntests - errors) * 100 / ntests);
+    if (ntests != 0) {
+       printf("check_addr: %d tests run, %d errors, %d%% success rate\n",
+           ntests, errors, (ntests - errors) * 100 / ntests);
+    }
 
     exit(errors);
 }