From 800dbf203d5af67b9a115a4b6f1f84ca448bc755 Mon Sep 17 00:00:00 2001 From: Ron Yorston Date: Sun, 16 Feb 2020 09:46:35 +0000 Subject: win32: save a few bytes in statfs Use memset() to fill the structure with zeroes, avoiding the need to set some members explicitly. Saves 16 bytes. --- win32/statfs.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/win32/statfs.c b/win32/statfs.c index 6b28792e2..97b3ce679 100644 --- a/win32/statfs.c +++ b/win32/statfs.c @@ -35,6 +35,8 @@ int statfs(const char *file, struct statfs *buf) return -1; } + memset(buf, 0, sizeof(*buf)); + /* XXX I couldn't determine how to get block size. MSDN has a * unhelpful hard-coded list here: * http://support.microsoft.com/kb/140365 @@ -58,10 +60,10 @@ int statfs(const char *file, struct statfs *buf) buf->f_blocks = total_number_of_bytes / buf->f_bsize; buf->f_bfree = total_number_of_free_bytes / buf->f_bsize; buf->f_bavail = free_bytes_available / buf->f_bsize; - buf->f_files = 0; - buf->f_ffree = 0; + //buf->f_files = 0; + //buf->f_ffree = 0; buf->f_fsid = serial; - buf->f_flag = 0; + //buf->f_flag = 0; buf->f_namelen = namelen; return 0; -- cgit v1.2.3-55-g6feb