diff options
author | George Hartzell <george.hartzell.gh1@contractors.roche.com> | 2016-09-29 14:30:44 -0700 |
---|---|---|
committer | George Hartzell <george.hartzell.gh1@contractors.roche.com> | 2016-09-29 14:30:44 -0700 |
commit | e2c01a16b75212f48e8e65bc53b7fb47329b544d (patch) | |
tree | ee269b6eb5a2930e2074d5f42d6d552fcd8c746f /examples | |
parent | d93dafd1f00f8ac550e73f0a83f36853e3db3e8f (diff) | |
download | libarchive-e2c01a16b75212f48e8e65bc53b7fb47329b544d.tar.gz |
Fix scoping error with "disk" variable
The variable named 'disk' inside the loop was hiding the variable named
'disk' at the outer level. The outer variable was never used, get rid
of it.
Move the call to archive_read_disk_set_standard_lookup(disk) inside the
loop so that it Does What It Should.
Diffstat (limited to 'examples')
-rw-r--r-- | examples/minitar/minitar.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/examples/minitar/minitar.c b/examples/minitar/minitar.c index 81e5e11c..0b4b4147 100644 --- a/examples/minitar/minitar.c +++ b/examples/minitar/minitar.c @@ -222,7 +222,6 @@ static void create(const char *filename, int compress, const char **argv) { struct archive *a; - struct archive *disk; struct archive_entry *entry; ssize_t len; int fd; @@ -253,12 +252,11 @@ create(const char *filename, int compress, const char **argv) filename = NULL; archive_write_open_filename(a, filename); - disk = archive_read_disk_new(); -#ifndef NO_LOOKUP - archive_read_disk_set_standard_lookup(disk); -#endif while (*argv != NULL) { struct archive *disk = archive_read_disk_new(); +#ifndef NO_LOOKUP + archive_read_disk_set_standard_lookup(disk); +#endif int r; r = archive_read_disk_open(disk, *argv); |