catch error from as.*printf

This commit is contained in:
Love Hornquist Astrand
2010-05-30 14:48:48 -07:00
parent f337b458f3
commit e65154c6db
6 changed files with 104 additions and 93 deletions

View File

@@ -124,7 +124,10 @@ test_principal (void)
for (i = 0; i < ntests; ++i) {
tests[i].val = &values[i];
asprintf (&tests[i].name, "Principal %d", i);
if (asprintf (&tests[i].name, "Principal %d", i) < 0)
errx(1, "malloc");
if (tests[i].name == NULL)
errx(1, "malloc");
}
ret = generic_test (tests, ntests, sizeof(Principal),
@@ -191,7 +194,10 @@ test_authenticator (void)
for (i = 0; i < ntests; ++i) {
tests[i].val = &values[i];
asprintf (&tests[i].name, "Authenticator %d", i);
if (asprintf (&tests[i].name, "Authenticator %d", i) < 0)
errx(1, "malloc");
if (tests[i].name == NULL)
errx(1, "malloc");
}
ret = generic_test (tests, ntests, sizeof(Authenticator),