From 8b8381f490bc5127911d1cc3b0b6f0ebb8c31035 Mon Sep 17 00:00:00 2001 From: Lev Walkin Date: Thu, 28 Sep 2006 07:45:14 +0000 Subject: flushing from the right point --- skeletons/per_support.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/skeletons/per_support.c b/skeletons/per_support.c index c8344193..0bb3d4b7 100644 --- a/skeletons/per_support.c +++ b/skeletons/per_support.c @@ -193,8 +193,8 @@ per_put_few_bits(asn_per_outp_t *po, uint32_t bits, int obits) { if(obits <= 0 || obits >= 32) return obits ? -1 : 0; - ASN_DEBUG("[PER put %d bits to %p+%d bits]", - obits, po->buffer, po->nboff); + ASN_DEBUG("[PER put %d bits %x to %p+%d bits]", + obits, bits, po->buffer, po->nboff); /* * Normalize position indicator. @@ -210,7 +210,9 @@ per_put_few_bits(asn_per_outp_t *po, uint32_t bits, int obits) { */ if(po->nboff + obits > po->nbits) { int complete_bytes = (po->buffer - po->tmpspace); - if(po->outper(po->buffer, complete_bytes, po->op_key) < 0) + ASN_DEBUG("[PER output %d complete + %d]", + complete_bytes, po->flushed_bytes); + if(po->outper(po->tmpspace, complete_bytes, po->op_key) < 0) return -1; if(po->nboff) po->tmpspace[0] = po->buffer[0]; -- cgit v1.2.3