From 6874b8022eafb0d96fb45488db1dd01f81fa0a74 Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Wed, 20 Feb 2002 14:42:30 +0000 Subject: [PATCH] Fixed BER decoding of OPTIONAL CHOICE --- CHANGELOG | 2 ++ odr/odr_choice.c | 15 +++++++++++---- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index d7862fe..08686e6 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -2,6 +2,8 @@ Possible compatibility problems with earlier versions marked with '*'. --- 1.8.6 2002/MM/DD +Fixed BER decoding of OPTIONAL CHOICE. + Added patch by Rustam T. Usmanov that implements Z39.50 duplicate detection service (Z39.50-1995 Amendment 2) and Language Negotiation (3). See: diff --git a/odr/odr_choice.c b/odr/odr_choice.c index 622203b..eb00387 100644 --- a/odr/odr_choice.c +++ b/odr/odr_choice.c @@ -1,10 +1,13 @@ /* - * Copyright (c) 1995-2000, Index Data + * Copyright (c) 1995-2002, Index Data * See the file LICENSE for details. * Sebastian Hammer, Adam Dickmeiss * * $Log: odr_choice.c,v $ - * Revision 1.18 2000-02-29 13:44:55 adam + * Revision 1.19 2002-02-20 14:42:30 adam + * Fixed BER decoding of OPTIONAL CHOICE + * + * Revision 1.18 2000/02/29 13:44:55 adam * Check for config.h (currently not generated). * * Revision 1.17 1999/11/30 13:47:11 adam @@ -76,6 +79,12 @@ int odr_choice(ODR o, Odr_arm arm[], void *p, void *whichp, return 0; if (o->direction != ODR_DECODE && !*(char**)p) return 0; + + if (o->direction == ODR_DECODE) + { + *which = -1; + *(char**)p = 0; + } o->choice_bias = -1; if (o->direction == ODR_PRINT) @@ -131,8 +140,6 @@ int odr_choice(ODR o, Odr_arm arm[], void *p, void *whichp, return 1; } } - *which = -1; - *(char*)p = 0; return 0; } -- 1.7.10.4