From 81ecaac7f0f293518366ed23855f38ec6df59ae0 Mon Sep 17 00:00:00 2001 From: Dnomd343 Date: Mon, 3 Oct 2022 00:05:16 +0800 Subject: [PATCH] fix: assets extract command --- src/utils/assets.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/utils/assets.c b/src/utils/assets.c index fda0ba5..6b9bb89 100644 --- a/src/utils/assets.c +++ b/src/utils/assets.c @@ -81,8 +81,8 @@ void extract(const char *file) { // extract one asset file from `.tar.xz` file } free(output_file); - char *extract_cmd = (char *)malloc(strlen(ASSETS_PKG) + strlen(file) + strlen(ASSETS_DIR) + 15); - sprintf(extract_cmd, "tar xf %s ./%s -C %s", ASSETS_PKG, file, ASSETS_DIR); + char *extract_cmd = (char *)malloc(strlen(ASSETS_PKG) + strlen(file) + strlen(ASSETS_DIR) + 13); + sprintf(extract_cmd, "tar xf %s %s -C %s", ASSETS_PKG, file, ASSETS_DIR); if (run_command(extract_cmd)) { log_warn("Extract asset `%s` failed", file); } else {