X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=odr%2Fodr_cons.c;h=3fdae22df176701d7a65065c6c83ae5e506387fd;hb=88ad85bd973c764146777e7cfe2e4a56c71994b9;hp=043bb76b684a13fb870c027b18071d535aad731b;hpb=a7d28a25277a208edb9c44d124f179cc2be6db70;p=yaz-moved-to-github.git diff --git a/odr/odr_cons.c b/odr/odr_cons.c index 043bb76..3fdae22 100644 --- a/odr/odr_cons.c +++ b/odr/odr_cons.c @@ -4,29 +4,35 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: odr_cons.c,v $ - * Revision 1.1 1995-02-02 16:21:53 quinn + * Revision 1.3 1995-02-09 15:51:48 quinn + * Works better now. + * + * Revision 1.2 1995/02/07 17:52:59 quinn + * A damn mess, but now things work, I think. + * + * Revision 1.1 1995/02/02 16:21:53 quinn * First kick. * */ #include -int odr_constructed_begin(ODR o, void *p, int class, int tag, int opt) +int odr_constructed_begin(ODR o, void *p, int class, int tag) { int res; int cons = 1; - if (o->direction == ODR_ENCODE && !*(char*)p) - return opt; if (o->t_class < 0) { o->t_class = class; o->t_tag = tag; } - if ((res = ber_tag(o, p, o->t_class, o->t_tag, &cons)) < 0) + if (o->direction == ODR_DECODE) + *(char**)p = 0; + if ((res = ber_tag(o, *(char**)p, o->t_class, o->t_tag, &cons)) < 0) return 0; if (!res || !cons) - return opt; + return 0; o->stack[++(o->stackp)].lenb = o->bp; if (o->direction == ODR_ENCODE || o->direction == ODR_PRINT)