summaryrefslogtreecommitdiff
path: root/libstore
diff options
context:
space:
mode:
authorMiles Bader <miles@gnu.org>1997-06-20 05:18:07 +0000
committerMiles Bader <miles@gnu.org>1997-06-20 05:18:07 +0000
commitae1df487b43abf9c64ba982d379b51f24cfad3c3 (patch)
tree8345a5e33aa8223b8dd28dfaaa0e170bcbcd143c /libstore
parent982fae930391d8c3a40620e9d68af95c12240582 (diff)
(store_decode):
Pass the original value of CLASSES to any decode method, not our search tail. Update FSF address.
Diffstat (limited to 'libstore')
-rw-r--r--libstore/decode.c18
1 files 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 <miles@gnu.ai.mit.edu>
-
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 <string.h>
#include <malloc.h>
@@ -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;
}