diff options
author | bigbiff bigbiff <bigbiff@teamw.in> | 2013-03-07 15:59:37 +0100 |
---|---|---|
committer | bigbiff bigbiff <bigbiff@teamw.in> | 2013-03-08 00:08:12 +0100 |
commit | 998716f0cbc07a7486925810442dc81c8d13c31c (patch) | |
tree | e0321ff6383b990d92b95089f31e916ac29fe37d /exfat/libexfat/io.c | |
parent | use md5.c for computation of md5sums (diff) | |
download | android_bootable_recovery-998716f0cbc07a7486925810442dc81c8d13c31c.tar android_bootable_recovery-998716f0cbc07a7486925810442dc81c8d13c31c.tar.gz android_bootable_recovery-998716f0cbc07a7486925810442dc81c8d13c31c.tar.bz2 android_bootable_recovery-998716f0cbc07a7486925810442dc81c8d13c31c.tar.lz android_bootable_recovery-998716f0cbc07a7486925810442dc81c8d13c31c.tar.xz android_bootable_recovery-998716f0cbc07a7486925810442dc81c8d13c31c.tar.zst android_bootable_recovery-998716f0cbc07a7486925810442dc81c8d13c31c.zip |
Diffstat (limited to 'exfat/libexfat/io.c')
-rw-r--r-- | exfat/libexfat/io.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/exfat/libexfat/io.c b/exfat/libexfat/io.c index 1be028cf3..7f79d97c0 100644 --- a/exfat/libexfat/io.c +++ b/exfat/libexfat/io.c @@ -2,7 +2,7 @@ io.c (02.09.09) exFAT file system implementation library. - Copyright (C) 2010-2012 Andrew Nayenko + Copyright (C) 2010-2013 Andrew Nayenko This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -350,10 +350,13 @@ ssize_t exfat_generic_pwrite(struct exfat* ef, struct exfat_node* node, cluster_t cluster; const char* bufp = buffer; off64_t lsize, loffset, remainder; - printf("node: %s\n", node); - if (offset + size > node->size) - if (exfat_truncate(ef, node, offset + size) != 0) - return -1; + + if (offset > node->size) + if (exfat_truncate(ef, node, offset, true) != 0) + return -1; + if (offset + size > node->size) + if (exfat_truncate(ef, node, offset + size, false) != 0) + return -1; if (size == 0) return 0; |