diff options
| -rw-r--r-- | tools/afcclient.c | 2 |
1 files changed, 1 insertions, 1 deletions
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) | |||
| 922 | 922 | ||
| 923 | // target is a directory, put file under this target | 923 | // target is a directory, put file under this target |
| 924 | if (is_directory(dstpath)) { | 924 | if (is_directory(dstpath)) { |
| 925 | const char *basen = path_get_basename(argv[0]); | 925 | const char *basen = path_get_basename(srcpath); |
| 926 | uint8_t dst_is_root = strcmp(dstpath, "/") == 0; | 926 | uint8_t dst_is_root = strcmp(dstpath, "/") == 0; |
| 927 | size_t len = dst_is_root ? (strlen(basen) + 2) : (strlen(dstpath) + 1 + strlen(basen) + 1); | 927 | size_t len = dst_is_root ? (strlen(basen) + 2) : (strlen(dstpath) + 1 + strlen(basen) + 1); |
| 928 | char *newdst = (char *) malloc(len); | 928 | char *newdst = (char *) malloc(len); |
