summaryrefslogtreecommitdiff
path: root/libdiskfs/node-rdwr.c
diff options
context:
space:
mode:
Diffstat (limited to 'libdiskfs/node-rdwr.c')
-rw-r--r--libdiskfs/node-rdwr.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/libdiskfs/node-rdwr.c b/libdiskfs/node-rdwr.c
index 888f2497..79c94f8d 100644
--- a/libdiskfs/node-rdwr.c
+++ b/libdiskfs/node-rdwr.c
@@ -58,7 +58,10 @@ diskfs_node_rdwr (struct node *np,
amt = np->dn_stat.st_size - off;
}
- *amtread = amt;
+ if (amtread)
+ *amtread = amt;
+ else
+ amtread = &amt;
err = _diskfs_rdwr_internal (np, data, off, amtread, dir, 0);
if (*amtread && diskfs_synchronous)
{