Commit cfeecfb2 authored by Lev Walkin's avatar Lev Walkin

forward compatibility

parent 6f09f69f
......@@ -34,7 +34,7 @@ check(int type, char *tagname, char *xmlbuf, char *verify) {
rc = decoder(0, td, (void **)&st, tagname, xmlbuf, xmllen);
printf("[%s] => [%s]:%d vs [%s]:%d, code %d\n",
xmlbuf,
st ? st->buf : "", st ? st->size : 0,
st ? (const char *)st->buf : "", st ? st->size : 0,
verify ? verify : "", verlen, rc.code);
if(verify) {
......@@ -68,6 +68,8 @@ main() {
check(HEX, "z", "<z><!-- <some <sometag>-->40</z>", "@");
check(HEX, "z", "<z><!-- <some <sometag-->>40</z>", 0);
check(HEX, "z", "ignored<z>40</z>stuff", "@");
check(HEX, "tag", "<tag>4</tag>", "@");
check(BINARY, "tag", "<tag/>", "");
......
......@@ -220,11 +220,15 @@ xer_decode_general(asn_codec_ctx_t *opt_codec_ctx,
continue;
case PXER_TEXT:
if(ctx->phase == 0) {
/* Unexpected data */
/* TODO: ignore whitespace? */
RETURN(RC_FAIL);
}
/*
* We have to ignore whitespace here,
* but in order to be forward compatible
* with EXTENDED-XER (EMBED-VALUES, #25)
* any text is just ignored here.
*/
} else {
XER_GOT_BODY(buf_ptr, ch_size);
}
ADVANCE(ch_size);
continue;
case PXER_TAG:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment