comparison 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
comparison
equal deleted inserted replaced
4:b5c4267a7182 5:0b1bce8db371
170 struct pws3_field *uuid_field; 170 struct pws3_field *uuid_field;
171 const unsigned char *uuid; 171 const unsigned char *uuid;
172 struct record_id_entry *entry; 172 struct record_id_entry *entry;
173 173
174 if (pws3_file_read_stream(ctx->file, ctx->password, fp) != 0) { 174 if (pws3_file_read_stream(ctx->file, ctx->password, fp) != 0) {
175 warnx("failed to read password database: %s", 175 fprintf(stderr, "failed to read password database: %s\n",
176 pws3_file_get_error_message(ctx->file)); 176 pws3_file_get_error_message(ctx->file));
177 return (-1); 177 return (-1);
178 } 178 }
179 179
180 record_id_tree_clear(ctx->record_id_tree); 180 record_id_tree_clear(ctx->record_id_tree);