diff options
Diffstat (limited to 'runtime/librsgt_read.c')
-rw-r--r-- | runtime/librsgt_read.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/runtime/librsgt_read.c b/runtime/librsgt_read.c index 25c0db4..bcb0099 100644 --- a/runtime/librsgt_read.c +++ b/runtime/librsgt_read.c @@ -249,7 +249,7 @@ rsgt_tlvRecRead(FILE *fp, tlvrecord_t *rec) NEXTC; rec->hdr[0] = c; rec->tlvtype = c & 0x1f; - if(c & 0x20) { /* tlv16? */ + if(c & RSGT_FLAG_TLV16) { /* tlv16? */ rec->lenHdr = 4; NEXTC; rec->hdr[1] = c; @@ -267,7 +267,7 @@ rsgt_tlvRecRead(FILE *fp, tlvrecord_t *rec) rec->tlvlen = c; } if(fread(rec->data, (size_t) rec->tlvlen, 1, fp) != 1) { - r = RSGTE_IO; + r = feof(fp) ? RSGTE_EOF : RSGTE_IO; goto done; } @@ -290,7 +290,7 @@ rsgt_tlvDecodeSUBREC(tlvrecord_t *rec, uint16_t *stridx, tlvrecord_t *newrec) c = rec->data[(*stridx)++]; newrec->hdr[0] = c; newrec->tlvtype = c & 0x1f; - if(c & 0x20) { /* tlv16? */ + if(c & RSGT_FLAG_TLV16) { /* tlv16? */ newrec->lenHdr = 4; if(rec->tlvlen == *stridx) {r=RSGTE_LEN; goto done;} c = rec->data[(*stridx)++]; @@ -611,9 +611,9 @@ rsgt_printBLOCK_SIG(FILE *fp, block_sig_t *bs, uint8_t verbose) fprintf(fp, "\tIV............: "); outputHexBlob(fp, bs->iv, getIVLen(bs), verbose); fputc('\n', fp); - fprintf(fp, "\tRecord Count..: %llu\n", bs->recCount); + fprintf(fp, "\tRecord Count..: %llu\n", (long long unsigned) bs->recCount); fprintf(fp, "\tSignature Type: %s\n", sigTypeName(bs->sigID)); - fprintf(fp, "\tSignature Len.: %u\n", bs->sig.der.len); + fprintf(fp, "\tSignature Len.: %u\n", (unsigned) bs->sig.der.len); fprintf(fp, "\tSignature.....: "); outputHexBlob(fp, bs->sig.der.data, bs->sig.der.len, verbose); fputc('\n', fp); |