From ae1df487b43abf9c64ba982d379b51f24cfad3c3 Mon Sep 17 00:00:00 2001 From: Miles Bader Date: Fri, 20 Jun 1997 05:18:07 +0000 Subject: (store_decode): Pass the original value of CLASSES to any decode method, not our search tail. Update FSF address. --- libstore/decode.c | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/libstore/decode.c b/libstore/decode.c index e21c6e72..c68f8386 100644 --- a/libstore/decode.c +++ b/libstore/decode.c @@ -1,9 +1,7 @@ /* Store wire decoding - Copyright (C) 1996 Free Software Foundation, Inc. - + Copyright (C) 1996, 1997 Free Software Foundation, Inc. Written by Miles Bader - This file is part of the GNU Hurd. The GNU Hurd is free software; you can redistribute it and/or @@ -18,7 +16,7 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA. */ #include #include @@ -160,6 +158,8 @@ error_t store_decode (struct store_enc *enc, const struct store_class *const *classes, struct store **store) { + const struct store_class *const *cl; + if (enc->cur_int >= enc->num_ints) /* The first int should always be the type. */ return EINVAL; @@ -167,14 +167,12 @@ store_decode (struct store_enc *enc, const struct store_class *const *classes, if (! classes) classes = store_std_classes; - while (*classes) - if ((*classes)->id == enc->ints[enc->cur_int]) - if ((*classes)->decode) - return (*(*classes)->decode) (enc, classes, store); + for (cl = classes; *classes; cl ++) + if ((*cl)->id == enc->ints[enc->cur_int]) + if ((*cl)->decode) + return (*(*cl)->decode) (enc, classes, store); else return EOPNOTSUPP; - else - classes++; return EINVAL; } -- cgit v1.2.3