Skip to content

Commit

Permalink
[unber] fix output regression
Browse files Browse the repository at this point in the history
  • Loading branch information
vlm committed Jan 23, 2019
1 parent f8b6e73 commit 0906e58
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions asn1-tools/unber/libasn1_unber_tool.c
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ process_deeper(const char *fname, input_stream_t *ibs, output_stream_t *os,
}

if(!expect_eoc || tagbuf[0] || tagbuf[1])
print_TL(os, 0, ibs->bytesRead(ibs), level, constr, tblen,
print_TL(os, 0, ibs->bytesRead(ibs) - tblen, level, constr, tblen,
tlv_tag, tlv_len, effective_size);

if(limit != -1) {
Expand All @@ -248,7 +248,7 @@ process_deeper(const char *fname, input_stream_t *ibs, output_stream_t *os,

if(expect_eoc && !tagbuf[0] && !tagbuf[1]) {
/* End of content octets */
print_TL(os, 1, ibs->bytesRead(ibs), level - 1, 1, 2, 0, -1,
print_TL(os, 1, ibs->bytesRead(ibs) - 2, level - 1, 1, 2, 0, -1,
effective_size);
return PD_FINISHED;
}
Expand Down Expand Up @@ -642,6 +642,7 @@ unber_file(const char *fname) {
ifs.istream.nextChar = file_input_stream_nextChar;
ifs.istream.bytesRead = file_input_stream_bytesRead;
ifs.fp = fp;
ifs.offset = 0;

struct file_output_stream ofs;
ofs.ostream.vprintf = file_output_stream_vprintf;
Expand Down

0 comments on commit 0906e58

Please sign in to comment.