* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "config.h"
+#ifdef HAVE_CONFIG_H
+# include "config.h" /* Need for PACKAGE_VERSION, etc. */
+#endif
+
#include "wimlib.h"
#include "wimlib_tchar.h"
#include <locale.h>
#ifdef HAVE_ALLOCA_H
-#include <alloca.h>
+# include <alloca.h>
#endif
#ifdef __WIN32__
};
static void usage(int cmd_type);
-static void usage_all();
+static void usage_all(void);
static bool imagex_be_quiet = false;
wimfile = argv[0];
+ ret = file_writable(wimfile);
+ if (ret)
+ return ret;
+
ret = wimlib_open_wim(wimfile, open_flags, &w,
imagex_progress_func);
- if (ret != 0)
+ if (ret)
return ret;
old_size = file_get_size(argv[0]);
if (argc < 1 || argc > 2)
goto out_usage;
wimfile = argv[0];
+
+ ret = file_writable(wimfile);
+ if (ret)
+ goto out;
+
ret = wimlib_open_wim(wimfile, open_flags, &wim, imagex_progress_func);
if (ret)
goto out;
};
static void
-version()
+version(void)
{
static const tchar *s =
T(
}
static void
-usage_all()
+usage_all(void)
{
tfputs(T("Usage:\n"), stdout);
for (int i = 0; i < ARRAY_LEN(usage_strings); i++)