diff options
author | Sergey Poznyakoff <gray@gnu.org> | 2018-07-02 19:46:24 +0300 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org> | 2018-07-02 19:46:24 +0300 |
commit | b4333893277f7e4e4b5e673c158cc8b68ce1ea93 (patch) | |
tree | 379eae4af3a8d9ade7c4bdff96430b65213ef1c8 | |
parent | 030e685eb9df82f63d73a1bf206da84b7aa52374 (diff) | |
download | gdbm-b4333893277f7e4e4b5e673c158cc8b68ce1ea93.tar.gz gdbm-b4333893277f7e4e4b5e673c158cc8b68ce1ea93.tar.bz2 |
Bugfixes
* src/recover.c (backup_name): Fix memory overwrite.
* src/gdbmtool.c (recover_handler): New option "force".
-rw-r--r-- | src/gdbmtool.c | 6 | ||||
-rw-r--r-- | src/recover.c | 2 |
2 files changed, 6 insertions, 2 deletions
diff --git a/src/gdbmtool.c b/src/gdbmtool.c index 5ae668c..454465e 100644 --- a/src/gdbmtool.c +++ b/src/gdbmtool.c @@ -593,2 +593,6 @@ recover_handler (struct handler_param *param) } + else if (strcmp (arg, "force") == 0) + { + flags |= GDBM_RCVR_FORCE; + } else if (strcmp (arg, "summary") == 0) @@ -599,3 +603,2 @@ recover_handler (struct handler_param *param) { - rcvr.errfun = err_printer; flags |= GDBM_RCVR_BACKUP; @@ -1265,2 +1268,3 @@ struct command command_tab[] = { { "[backup]", GDBM_ARG_STRING }, + { "[force]", GDBM_ARG_STRING }, { "[max-failed-keys=N]", GDBM_ARG_STRING }, diff --git a/src/recover.c b/src/recover.c index f6859ea..a64a1b4 100644 --- a/src/recover.c +++ b/src/recover.c @@ -54,3 +54,3 @@ backup_name (char const *name) - len = strlen (name + sizeof (INITIAL_SUFFIX)); + len = strlen (name) + sizeof (INITIAL_SUFFIX); buf = malloc (len); |