diff options
author | Roland McGrath <roland@gnu.org> | 2002-06-07 09:05:47 +0000 |
---|---|---|
committer | Roland McGrath <roland@gnu.org> | 2002-06-07 09:05:47 +0000 |
commit | 3b95daef9659faf53928e1272a573e4666462a96 (patch) | |
tree | 848160f7cb13a14fbf9d3039b75d9578d2ef4da4 /libstore | |
parent | 591ffe06b650daceabb32aef312f3a3cae8e642e (diff) |
2002-06-07 Roland McGrath <roland@frob.com>
* encode.c (store_std_leaf_encode): Do a sizeof comparison to get
`too_big' optimized out when store_enc starts using 64 bit offsets.
Diffstat (limited to 'libstore')
-rw-r--r-- | libstore/encode.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/libstore/encode.c b/libstore/encode.c index 7d119666..df27250d 100644 --- a/libstore/encode.c +++ b/libstore/encode.c @@ -1,6 +1,6 @@ /* Store wire encoding - Copyright (C) 1996, 1997, 1999,2001 Free Software Foundation, Inc. + Copyright (C) 1996,97,99,2001,02 Free Software Foundation, Inc. Written by Miles Bader <miles@gnu.org> This file is part of the GNU Hurd. @@ -62,8 +62,9 @@ store_std_leaf_encode (const struct store *store, struct store_enc *enc) for (i = 0; i < store->num_runs; i++) { - if (too_big (store->runs[i].start) - || too_big (store->runs[i].start + store->runs[i].length)) + if (sizeof (*enc->offsets) != sizeof (store->runs[i].start) + && (too_big (store->runs[i].start) + || too_big (store->runs[i].start + store->runs[i].length))) return EOVERFLOW; enc->offsets[enc->cur_offset++] = store->runs[i].start; enc->offsets[enc->cur_offset++] = store->runs[i].length; |