Avoid division by zero if there was no test data.

This commit is contained in:
Todd C. Miller
2014-09-03 10:29:46 -06:00
parent f95ca8d4f0
commit b3586c46e2

View File

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