X-Git-Url: http://git.indexdata.com/?p=yaz-moved-to-github.git;a=blobdiff_plain;f=odr%2Fber_tag.c;h=a0e39bbdc072a53ccd87223f2374b1dc23c43586;hp=64c15e0a2fbb7a39478889e9b0b5405339e3db4d;hb=c3a132ce4aea3bb358b185ef58781b4bef8745fc;hpb=eb2d32be86dd9b1db4303f37dcd4bc3b8927e5ad diff --git a/odr/ber_tag.c b/odr/ber_tag.c index 64c15e0..a0e39bb 100644 --- a/odr/ber_tag.c +++ b/odr/ber_tag.c @@ -4,7 +4,10 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: ber_tag.c,v $ - * Revision 1.8 1995-03-10 11:44:40 quinn + * Revision 1.9 1995-03-15 08:37:18 quinn + * Fixed protocol bugs. + * + * Revision 1.8 1995/03/10 11:44:40 quinn * Fixed serious stack-bug in odr_cons_begin * * Revision 1.7 1995/03/08 12:12:13 quinn @@ -57,6 +60,8 @@ int ber_tag(ODR o, void *p, int class, int tag, int *constructed, int opt) { o->bp = o->buf; lclass = -1; + if (o->direction == ODR_ENCODE) + o->left = o->buflen; } switch (o->direction) { @@ -76,8 +81,8 @@ int ber_tag(ODR o, void *p, int class, int tag, int *constructed, int opt) o->bp += rd; o->left -= rd; #ifdef ODR_DEBUG - fprintf(stderr, "\n[class=%d,tag=%d,cons=%d,stackp=%d]", class, tag, - *constructed, o->stackp); + fprintf(stderr, "\n[class=%d,tag=%d,cons=%d,stackp=%d,left=%d]", class, tag, + *constructed, o->stackp, o->left); #endif return 1; case ODR_DECODE: