From a6b6c35d1550acbd2552d49c2fe38115deec8fc0 Mon Sep 17 00:00:00 2001 From: tomriddly Date: Thu, 25 Jul 2024 10:02:46 +0800 Subject: tool/afcclient: Fix local file name error on pulling folder from device Signed-off-by: tomriddly --- tools/afcclient.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tools') diff --git a/tools/afcclient.c b/tools/afcclient.c index 1546a6c..1cddb36 100644 --- a/tools/afcclient.c +++ b/tools/afcclient.c @@ -922,7 +922,7 @@ static void handle_get(afc_client_t afc, int argc, char **argv) // target is a directory, put file under this target if (is_directory(dstpath)) { - const char *basen = path_get_basename(argv[0]); + const char *basen = path_get_basename(srcpath); uint8_t dst_is_root = strcmp(dstpath, "/") == 0; size_t len = dst_is_root ? (strlen(basen) + 2) : (strlen(dstpath) + 1 + strlen(basen) + 1); char *newdst = (char *) malloc(len); -- cgit v1.1-32-gdbae