From 0d08f53d7081c5cc9383c16e49d89041faa6eff2 Mon Sep 17 00:00:00 2001 From: Adam Wick Date: Sat, 14 Apr 2018 06:59:49 -0700 Subject: [PATCH] Make sure we print 0. --- src/cryptonum/unsigned.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/cryptonum/unsigned.rs b/src/cryptonum/unsigned.rs index c68b738..29565a5 100644 --- a/src/cryptonum/unsigned.rs +++ b/src/cryptonum/unsigned.rs @@ -342,6 +342,9 @@ impl fmt::UpperHex for UCN { fmt.write_char(tochar_upper(x >> 4))?; fmt.write_char(tochar_upper(x >> 0))?; } + if self.contents.len() == 0 { + fmt.write_char('0')?; + } Ok(()) } }