Clean up pgpPrtPkts() and friends a bit
authorPanu Matilainen <pmatilai@redhat.com>
Sun, 6 Nov 2011 15:54:38 +0000 (17:54 +0200)
committerPanu Matilainen <pmatilai@redhat.com>
Mon, 7 Nov 2011 06:05:19 +0000 (08:05 +0200)
commit03879e09cf880adf6c2cec5c73779d77bd6a7f95
tree0bdbbbc02481535788fdb2e8100be3e2d9fcdeb6
parent3db9a10577f1868bcf6cc15fe76a03851af39355
Clean up pgpPrtPkts() and friends a bit

- Use decodePkt() for added initial sanity check + grabbing the "main" tag
  instead of duplicating the tag decoding here.
- Call decodePkt() from the main parse loop instead of pgpPrtPkt(),
  and return simple ok/error codes from pgpPrtPkt() and do the
  length calculation in the main loop.
- Besides making the code simpler and more obvious this fixes some
  fishy cases where we previously would've returned 0 for success
  despite there being an error.
rpmio/rpmpgp.c