Usage message and indentation cleanups in test program.

This commit is contained in:
Stephen Heumann 2017-06-27 23:42:20 -05:00
parent 4ffd064204
commit d4baf7dbe4
1 changed files with 15 additions and 7 deletions

View File

@ -15,6 +15,8 @@
*/
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
#include <MiscTool.h>
#include <Memory.h>
#include <orca.h>
@ -167,8 +169,14 @@ unsigned long aes128_time_test(unsigned int iters) {
int main(int argc, char **argv) {
unsigned int test_iters = 0;
if (argc > 1)
if (argc > 1) {
errno = 0;
test_iters = strtoul(argv[1], NULL, 10);
if (argc > 2 || errno != 0) {
fprintf(stderr, "Usage: aestest [test_iters]\n");
exit(1);
}
}
printf("AES-128 test:\n");
aes128_test();