From 3b95daef9659faf53928e1272a573e4666462a96 Mon Sep 17 00:00:00 2001 From: Roland McGrath Date: Fri, 7 Jun 2002 09:05:47 +0000 Subject: 2002-06-07 Roland McGrath * encode.c (store_std_leaf_encode): Do a sizeof comparison to get `too_big' optimized out when store_enc starts using 64 bit offsets. --- libstore/encode.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'libstore') 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 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; -- cgit v1.2.3