summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJustus Winter <justus@sequoia-pgp.org>2023-03-08 01:03:40 +0100
committerJustus Winter <justus@sequoia-pgp.org>2023-03-13 15:24:17 +0100
commitbee82c2952512a5585e93f180180ca45468d4f2b (patch)
tree77d220e479bc035c24807afff8ebc789d0b7a1cf
parentb9629b523ceec5fc51cbc6b0ba48302ff070eea1 (diff)
openpgp: Fix dumping fields ending on a 16 byte boundary.
-rw-r--r--openpgp/src/fmt.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/openpgp/src/fmt.rs b/openpgp/src/fmt.rs
index 4e04e74f..5f3cd206 100644
--- a/openpgp/src/fmt.rs
+++ b/openpgp/src/fmt.rs
@@ -108,6 +108,10 @@ pub mod hex {
where B: AsRef<[u8]>,
{
self.write_labeled(buf, |offset, data| {
+ if data.is_empty() {
+ return None;
+ }
+
let mut l = String::new();
for _ in 0..offset {
l.push(' ');