diff pwfile.c @ 5:0b1bce8db371

Prevent misleading double error message Display errors from the function where they occur. Only use warn(x) for system errors.
author Guido Berhoerster <guido+pwm@berhoerster.name>
date Sun, 05 Feb 2017 13:54:39 +0100
parents b5c4267a7182
children 60c8ab006e55
line wrap: on
line diff
--- a/pwfile.c	Sun Feb 05 13:30:31 2017 +0100
+++ b/pwfile.c	Sun Feb 05 13:54:39 2017 +0100
@@ -172,7 +172,7 @@
 	struct record_id_entry *entry;
 
 	if (pws3_file_read_stream(ctx->file, ctx->password, fp) != 0) {
-		warnx("failed to read password database: %s",
+		fprintf(stderr, "failed to read password database: %s\n",
 		    pws3_file_get_error_message(ctx->file));
 		return (-1);
 	}