From b4efa153019d2eba76e596ccf728e4406beaadd9 Mon Sep 17 00:00:00 2001 From: Miles Bader Date: Tue, 24 Sep 1996 19:38:22 +0000 Subject: (zero_open): When no size is specified, use the maximum off_t value, not the maximum size_t value. : New include. --- libstore/zero.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'libstore') diff --git a/libstore/zero.c b/libstore/zero.c index c75675d1..e0ba5f5e 100644 --- a/libstore/zero.c +++ b/libstore/zero.c @@ -24,6 +24,7 @@ #include #include #include +#include #include "store.h" @@ -124,7 +125,10 @@ zero_open (const char *name, int flags, return store_zero_create (size, flags, store); } else - return store_zero_create (~(size_t)0, flags, store); + { + off_t max_offs = ~((off_t)1 << (CHAR_BIT * sizeof (off_t) - 1)); + return store_zero_create (max_offs, flags, store); + } } static error_t -- cgit v1.2.3