summaryrefslogtreecommitdiff
path: root/libstore
diff options
context:
space:
mode:
authorMiles Bader <miles@gnu.org>1996-09-24 19:38:22 +0000
committerMiles Bader <miles@gnu.org>1996-09-24 19:38:22 +0000
commitb4efa153019d2eba76e596ccf728e4406beaadd9 (patch)
tree7156347b1f000539d4bb9d37e55e132b511c6b18 /libstore
parentf3cb518f6edf22cf31c230c89fc7affead3d55b1 (diff)
(zero_open):
When no size is specified, use the maximum off_t value, not the maximum size_t value. <limits.h>: New include.
Diffstat (limited to 'libstore')
-rw-r--r--libstore/zero.c6
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