Commit 451af473 authored by Lev Walkin's avatar Lev Walkin
Browse files

Removed confusion between &xNN; and &#xNN; in enber and unber.

parent eeab25b4
0.9.8: 2004-Oct-20
0.9.8: 2004-Oct-25
* Initial XER (XML) decoding implementation.
* -X command line option added to asn1c to generate XML DTD.
......@@ -7,6 +7,7 @@
* Code compiled and tested on Sun Solaris 9 @ sparc.
Improved includes/defines of/for system headers.
* ber_dec_rval_t renamed into asn_dec_rval_t: more generality.
* Removed confusion between &xNN; and &#xNN; in enber and unber.
0.9.7.1: 2004-Oct-12
......
......@@ -353,8 +353,13 @@ process_line(const char *fname, char *line, int lineno) {
continue;
}
cl++;
if(*cl != '#') {
fputc(*cl, stdout);
continue;
}
cl++;
if(*cl != 'x') {
fprintf(stderr, "%s: Expected \"&xNN;\" at line %d\n",
fprintf(stderr, "%s: Expected \"&#xNN;\" at line %d\n",
fname, lineno);
exit(EX_DATAERR);
}
......@@ -373,7 +378,7 @@ process_line(const char *fname, char *line, int lineno) {
v |= clv - 'a' + 10; break;
default:
fprintf(stderr,
"%s: Expected \"&xNN;\" at line %d (%c)\n",
"%s: Expected \"&#xNN;\" at line %d (%c)\n",
fname, lineno, clv);
exit(EX_DATAERR);
}
......@@ -381,7 +386,7 @@ process_line(const char *fname, char *line, int lineno) {
cl++;
if(*cl != ';') {
fprintf(stderr,
"%s: Expected \"&xNN;\" at line %d\n",
"%s: Expected \"&#xNN;\" at line %d\n",
fname, lineno);
exit(EX_DATAERR);
}
......
......@@ -480,14 +480,14 @@ print_V(const char *fname, FILE *fp, ber_tlv_tag_t tlv_tag, ber_tlv_len_t tlv_le
}
/* Fall through */
case '<': case '>': case '&':
printf("&x%02x;", ch);
printf("&#x%02x;", ch);
}
break;
case ASN_BASIC_BOOLEAN:
switch(ch) {
case 0: printf("<false/>"); break;
case 0xff: printf("<true/>"); break;
default: printf("<true value=\"&x%02x\"/>", ch);
default: printf("<true value=\"&#x%02x\"/>", ch);
}
break;
case ASN_BASIC_INTEGER:
......@@ -499,7 +499,7 @@ print_V(const char *fname, FILE *fp, ber_tlv_tag_t tlv_tag, ber_tlv_len_t tlv_le
if(vbuf) {
vbuf[i] = ch;
} else {
printf("&x%02x;", ch);
printf("&#x%02x;", ch);
}
}
}
......@@ -582,7 +582,7 @@ print_V(const char *fname, FILE *fp, ber_tlv_tag_t tlv_tag, ber_tlv_len_t tlv_le
printf(">");
for(i = 0; i < tlv_len; i++) {
if(binary > 0 || vbuf[i] < 0x20 || (vbuf[i] & 0x80))
printf("&x%02x;", vbuf[i]);
printf("&#x%02x;", vbuf[i]);
else
printf("%c", vbuf[i]);
}
......
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