diff options
author | Sergey Poznyakoff <gray@gnu.org> | 2018-05-30 11:01:00 +0300 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org> | 2018-05-30 11:01:00 +0300 |
commit | 07caec236e3af48973874f2c0e19bafec4d13f78 (patch) | |
tree | 924aa3e863ec347adbb23ab79ae5bfc2a63a422d /src | |
parent | ed14564822983b6b7cfa7b3c7d8104b15a019255 (diff) | |
download | gdbm-07caec236e3af48973874f2c0e19bafec4d13f78.tar.gz gdbm-07caec236e3af48973874f2c0e19bafec4d13f78.tar.bz2 |
gdbmtool: bugfixes
* src/gdbmtool.c (print_bucket_begin): Check return value from _gdbm_get_bucket.
(source_handler): Don't gtry to push NULL stream.
Diffstat (limited to 'src')
-rw-r--r-- | src/gdbmtool.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/gdbmtool.c b/src/gdbmtool.c index 46e3555..11b6f20 100644 --- a/src/gdbmtool.c +++ b/src/gdbmtool.c @@ -753,7 +753,11 @@ print_bucket_begin (struct handler_param *param, size_t *exp_count) terror (_("Not a bucket.")); return 1; } - _gdbm_get_bucket (gdbm_file, temp); + if (_gdbm_get_bucket (gdbm_file, temp)) + { + terror ("%s", gdbm_db_strerror (gdbm_file)); + return 1; + } if (exp_count) *exp_count = bucket_print_lines (gdbm_file->bucket) + 3; return 0; @@ -1132,7 +1136,7 @@ source_handler (struct handler_param *param) char *fname = tildexpand (PARAM_STRING (param, 0)); instream_t istr = instream_file_create (fname); free (fname); - if (input_context_push (istr) == 0) + if (istr && input_context_push (istr) == 0) yyparse (); } |