diff options
author | Justus Winter <justus@pep-project.org> | 2017-11-28 14:40:43 +0100 |
---|---|---|
committer | Justus Winter <justus@pep-project.org> | 2017-11-28 14:57:25 +0100 |
commit | 1c5b8fb42d22ea58481d8539e0f7638cbeaf31c2 (patch) | |
tree | 635d18143a6ef8e29aa3a595e46b5b000e08143b /src | |
parent | 016d63fde13220a7c7255c27b3e55e42a4be1fac (diff) |
Fix corner case.
- When armoring data of size zero, make sure that the header is
written even if 'write' is never called.
Diffstat (limited to 'src')
-rw-r--r-- | src/armor.rs | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/armor.rs b/src/armor.rs index 349b1d99..e070d2ab 100644 --- a/src/armor.rs +++ b/src/armor.rs @@ -120,6 +120,7 @@ impl<'a, W: Write> Writer<'a, W> { /// call. If this is not called explicitly, the header is written /// once the writer is dropped. pub fn finalize(&mut self) -> Result<(), Error> { + self.initialize()?; if self.finalized { return Err(Error::new(ErrorKind::BrokenPipe, "Writer is finalized.")); } |