]> Dogcows Code - chaz/tar/blobdiff - src/names.c
Fix use of uninitialized memory
[chaz/tar] / src / names.c
index 4710848fa1be4e740630b2bc70da59e102577978..6c9c3e9265a7793326c3a50b478cf2e4aee64c93 100644 (file)
@@ -291,6 +291,7 @@ name_add_file (const char *name, int term)
   ep->type = NELT_FILE;
   ep->v.file.name = name;
   ep->v.file.term = term;
+  ep->v.file.fp = NULL;
 }
 \f
 /* Names from external name file.  */
@@ -402,7 +403,7 @@ handle_option (const char *str)
   if (wordsplit (str, &ws, WRDSF_DEFFLAGS|WRDSF_DOOFFS))
     FATAL_ERROR ((0, 0, _("cannot split string '%s': %s"),
                  str, wordsplit_strerror (&ws)));
-  ws.ws_wordv[0] = "tar";
+  ws.ws_wordv[0] = program_invocation_short_name;
   more_options (ws.ws_wordc+ws.ws_offs, ws.ws_wordv);
   for (i = 0; i < ws.ws_wordc+ws.ws_offs; i++)
     ws.ws_wordv[i] = NULL;
@@ -414,8 +415,6 @@ handle_option (const char *str)
 static int
 read_next_name (struct name_elt *ent, struct name_elt *ret)
 {
-  enum read_file_list_state read_state;
-
   if (!ent->v.file.fp)
     {
       if (!strcmp (ent->v.file.name, "-"))
This page took 0.025769 seconds and 4 git commands to generate.