fixed bug

git-svn-id: https://asn1c.svn.sourceforge.net/svnroot/asn1c/trunk@662 59561ff5-6e30-0410-9f3c-9617f08c8826
This commit is contained in:
vlm 2005-02-18 12:26:20 +00:00
parent 97f4e0db48
commit 88c502842a
1 changed files with 8 additions and 4 deletions

View File

@ -163,16 +163,20 @@ xer_check_tag(const void *buf_ptr, int size, const char *need_tag) {
return rval; \
} while(0)
#define XER_GOT_BODY(chunk_buf, chunk_size) do { \
#define XER_GOT_BODY(chunk_buf, chunk_size, size) do { \
ssize_t converted_size = body_receiver \
(struct_key, chunk_buf, chunk_size, \
(size_t)chunk_size < size); \
if(converted_size == -1) RETURN(RC_FAIL); \
if(converted_size == 0 && size == chunk_size) { \
ctx->step = xer_state; \
RETURN(RC_WMORE); \
} \
chunk_size = converted_size; \
} while(0)
#define XER_GOT_EMPTY() do { \
ssize_t chunk_size = 0; \
XER_GOT_BODY(0, chunk_size); \
if(body_receiver(struct_key, 0, 0, size > 0) == -1) \
RETURN(RC_FAIL); \
} while(0)
/*
@ -231,7 +235,7 @@ xer_decode_general(asn_codec_ctx_t *opt_codec_ctx,
* any text is just ignored here.
*/
} else {
XER_GOT_BODY(buf_ptr, ch_size);
XER_GOT_BODY(buf_ptr, ch_size, size);
}
ADVANCE(ch_size);
continue;