From 998716f0cbc07a7486925810442dc81c8d13c31c Mon Sep 17 00:00:00 2001 From: bigbiff bigbiff Date: Thu, 7 Mar 2013 09:59:37 -0500 Subject: Update exfat to newest commits Change-Id: If15df21a556d39e6325ca8338345b698b9d8759d --- exfat/libexfat/io.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'exfat/libexfat/io.c') 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; -- cgit v1.2.3