X-Git-Url: https://wimlib.net/git/?p=wimlib;a=blobdiff_plain;f=programs%2Fimagex.c;h=8e9e95218794e2481827406bcbf15781e6e30957;hp=688b1e172dbdef2266f66d68dfe68bed785d1d03;hb=6bfd39a86273062b28536d4aec66893bc2fecdc0;hpb=f4a194333c5856d466d096c306f709edd19d1cc8 diff --git a/programs/imagex.c b/programs/imagex.c index 688b1e17..8e9e9521 100644 --- a/programs/imagex.c +++ b/programs/imagex.c @@ -35,9 +35,6 @@ #define ARRAY_LEN(array) (sizeof(array) / sizeof(array[0])) -#define swap(a, b) ({ typeof(a) __a = (a); typeof(b) __b = (b); \ - a = __b; b = __a; }) - #define for_opt(c, opts) while ((c = getopt_long_only(argc, (char**)argv, "", \ opts, NULL)) != -1) @@ -199,24 +196,6 @@ static void imagex_error_with_errno(const char *format, ...) va_end(va); } -static const char *path_basename(const char *path) -{ - const char *p = path; - while (*p) - p++; - p--; - - /* Trailing slashes. */ - while ((p != path - 1) && *p == '/') - p--; - - while ((p != path - 1) && *p != '/') - p--; - - return p + 1; -} - - static int verify_image_exists(int image) { if (image == WIM_NO_IMAGE) { @@ -467,9 +446,11 @@ static int imagex_apply(int argc, const char **argv) additional_swms, num_additional_swms); out: wimlib_free(w); - if (additional_swms) + if (additional_swms) { for (unsigned i = 0; i < num_additional_swms; i++) wimlib_free(additional_swms[i]); + free(additional_swms); + } return ret; } @@ -859,9 +840,11 @@ static int imagex_export(int argc, const char **argv) out: wimlib_free(src_w); wimlib_free(dest_w); - if (additional_swms) + if (additional_swms) { for (unsigned i = 0; i < num_additional_swms; i++) wimlib_free(additional_swms[i]); + free(additional_swms); + } return ret; } @@ -1116,7 +1099,7 @@ static int imagex_info(int argc, const char **argv) } } out: - wimlib_free(w); + /*wimlib_free(w);*/ return ret; }