aboutsummaryrefslogtreecommitdiffstats
path: root/src/clone_data.c
diff options
context:
space:
mode:
authorfishsoupisgood <github@madingley.org>2018-05-14 02:40:06 +0100
committerfishsoupisgood <github@madingley.org>2018-05-14 02:40:06 +0100
commitec9eb54d2f36f9c98607b5fc8745f978cfebd63e (patch)
treee8570d2f581d844ce24d02eb9d89bdd156d3cd2c /src/clone_data.c
parentb8e2bb419265d10c11fc5840aabce81379bb242d (diff)
downloadext_clone-ec9eb54d2f36f9c98607b5fc8745f978cfebd63e.tar.gz
ext_clone-ec9eb54d2f36f9c98607b5fc8745f978cfebd63e.tar.bz2
ext_clone-ec9eb54d2f36f9c98607b5fc8745f978cfebd63e.zip
support non extents and fast symlinks
Diffstat (limited to 'src/clone_data.c')
-rw-r--r--src/clone_data.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/clone_data.c b/src/clone_data.c
index 3083914..24aaf62 100644
--- a/src/clone_data.c
+++ b/src/clone_data.c
@@ -44,9 +44,10 @@ int clone_data (ext2_filsys src_fs, ext2_filsys dst_fs, ext2_ino_t i_num, struct
file_len -= offset;
- if (len > file_len)
+ if ((len > file_len) || (!len))
len = file_len;
+
while (len) {
fetch = len > BUF_SZ ? BUF_SZ : len;