aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org>2021-11-18 12:22:59 +0200
committerSergey Poznyakoff <gray@gnu.org>2021-11-18 12:22:59 +0200
commitf3c7872fed5e0782438d186ac88c63035a637462 (patch)
treefec0e4683eec3e66f547187f5b666132b0f5aa8f /src
parentbc2a36294a31e7e65004b129e2c8a5057e5f9bac (diff)
downloadgdbm-f3c7872fed5e0782438d186ac88c63035a637462.tar.gz
gdbm-f3c7872fed5e0782438d186ac88c63035a637462.tar.bz2
Fix gdbmtool import command
* src/gdbmshell.c (import_handler): Fix option addressing (see https://puszcza.gnu.org.ua/bugs/?535). Fix freeing of the uninitialized variable.
Diffstat (limited to 'src')
-rw-r--r--src/gdbmshell.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/gdbmshell.c b/src/gdbmshell.c
index 08042ce..96b5844 100644
--- a/src/gdbmshell.c
+++ b/src/gdbmshell.c
@@ -661,7 +661,7 @@ err_printer (void *data GDBM_ARG_UNUSED, char const *fmt, ...)
fprintf (stderr, "\n");
}
-/* recover sumamry verbose backup max-failed-keys=N max-failed-buckets=N max-failures=N */
+/* recover summary verbose backup max-failed-keys=N max-failed-buckets=N max-failures=N */
static int
recover_handler (struct command_param *param, struct command_environ *cenv)
{
@@ -1585,7 +1585,7 @@ import_handler (struct command_param *param,
int rc = GDBMSHELL_OK;
char *file_name;
- for (i = 0; i < param->argc; i++)
+ for (i = 1; i < param->argc; i++)
{
if (strcmp (PARAM_STRING (param, i), "replace") == 0)
flag = GDBM_REPLACE;
@@ -1637,7 +1637,6 @@ import_handler (struct command_param *param,
return GDBMSHELL_GDBM_ERR;
}
- free (file_name);
if (gdbm_setopt (gdbm_file, GDBM_GETDBNAME, &file_name, sizeof (file_name)))
{
dberror ("%s", "GDBM_GETDBNAME");

Return to:

Send suggestions and report system problems to the System administrator.