diff utils/sws-card-lookup.c @ 28:fa81221ac9b6

retrieval of required db fields moved into libutil
author Mychaela Falconia <falcon@freecalypso.org>
date Tue, 16 Mar 2021 23:37:36 +0000
parents ca8a6f95826a
children
line wrap: on
line diff
--- a/utils/sws-card-lookup.c	Tue Mar 16 23:22:37 2021 +0000
+++ b/utils/sws-card-lookup.c	Tue Mar 16 23:37:36 2021 +0000
@@ -48,11 +48,9 @@
 {
 	char *val;
 
-	val = dbread_find_key(&dbs, key);
-	if (!val) {
-		fprintf(stderr, "error: card record has no %s field\n", key);
-		exit(1);
-	}
+	val = dbread_find_key_req(&dbs, key);
+	if (!val)
+		exit(1);	/* error msg already printed */
 	puts(val);
 }