diff options
-rw-r--r-- | libstore/zero.c | 6 |
1 files changed, 5 insertions, 1 deletions
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 <stdio.h> #include <stdlib.h> #include <string.h> +#include <limits.h> #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 |