changeset 105:b1bf0ec6fff5

fc-simtool: pb-dump: first round of bugfixes
author Mychaela Falconia <falcon@freecalypso.org>
date Mon, 25 Jan 2021 05:59:33 +0000
parents a60645b75a57
children 66f04193a906
files simtool/pbcommon.c simtool/pbdump.c
diffstat 2 files changed, 4 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/simtool/pbcommon.c	Mon Jan 25 05:55:40 2021 +0000
+++ b/simtool/pbcommon.c	Mon Jan 25 05:59:33 2021 +0000
@@ -39,11 +39,11 @@
 	struct map *tp;
 	int rc;
 
-	for (tp = phonebook_map; *tp->user_name; tp++)
+	for (tp = phonebook_map; tp->user_name; tp++)
 		if (!strcmp(tp->user_name, reqname))
 			break;
 	if (!tp->canon_name) {
-		fprintf(stderr, "error: phone book name \"%s\" not known",
+		fprintf(stderr, "error: phone book name \"%s\" not known\n",
 			reqname);
 		return(-1);
 	}
--- a/simtool/pbdump.c	Mon Jan 25 05:55:40 2021 +0000
+++ b/simtool/pbdump.c	Mon Jan 25 05:59:33 2021 +0000
@@ -114,6 +114,8 @@
 	unsigned recno;
 
 	rc = phonebook_op_common(argv[1]);
+	if (rc < 0)
+		return(rc);
 	if (argv[2]) {
 		outf = fopen(argv[2], "w");
 		if (!outf) {