summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorReverend Homer <mk.43.ecko@gmail.com>2016-12-06 12:08:38 +0300
committerReverend Homer <mk.43.ecko@gmail.com>2016-12-06 12:08:38 +0300
commit77d7ee32fb981b037ac8614a3d0164d883569cdc (patch)
tree5dc2b1478ac3452c101b976a2218de7d37539222
parentb2da11ca2eb26d55502423c85de1f9ae1b37e415 (diff)
downloadlibmtp-fix-examples.tar.gz
examples: make mtp-files and mtp-filetree much fasterfix-examples
If we put 0 as leaf, the device will give file list for all directories, not just root of sdcard, so recurtion will not make any sense. So put 0xffffffff instead that means "root directory only"
-rw-r--r--examples/files.c2
-rw-r--r--examples/filetree.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/examples/files.c b/examples/files.c
index 8c3e586..a083308 100644
--- a/examples/files.c
+++ b/examples/files.c
@@ -139,7 +139,7 @@ int main(int argc, char **argv)
/* Loop over storages */
for (storage = device->storage; storage != 0; storage = storage->next) {
- dump_files(device, storage->id, 0);
+ dump_files(device, storage->id, 0xffffffff);
}
LIBMTP_Release_Device(device);
}
diff --git a/examples/filetree.c b/examples/filetree.c
index 234d093..e1f2e4e 100644
--- a/examples/filetree.c
+++ b/examples/filetree.c
@@ -147,7 +147,7 @@ int main (int argc, char **argv)
/* Loop over storages */
for (storage = device->storage; storage != 0; storage = storage->next) {
fprintf(stdout, "Storage: %s\n", storage->StorageDescription);
- recursive_file_tree(device, storage, 0, 0);
+ recursive_file_tree(device, storage, 0xffffffff, 0);
}
bailout: