From 01e229346cf66674556f6d6e9eb6f0c807f00907 Mon Sep 17 00:00:00 2001 From: Jacob Hoffman-Andrews Date: Mon, 1 Jun 2020 18:29:50 -0700 Subject: [PATCH] Write "error" when there is an error. --- openssl/src/asn1.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openssl/src/asn1.rs b/openssl/src/asn1.rs index 2670ce779..4140cd5ec 100644 --- a/openssl/src/asn1.rs +++ b/openssl/src/asn1.rs @@ -68,7 +68,7 @@ impl fmt::Display for Asn1GeneralizedTimeRef { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { unsafe { let mem_bio = match MemBio::new() { - Err(_) => return f.write_str(""), + Err(_) => return f.write_str("error"), Ok(m) => m, }; let print_result = cvt(ffi::ASN1_GENERALIZEDTIME_print( @@ -76,7 +76,7 @@ impl fmt::Display for Asn1GeneralizedTimeRef { self.as_ptr(), )); match print_result { - Err(_) => f.write_str(""), + Err(_) => f.write_str("error"), Ok(_) => f.write_str(str::from_utf8_unchecked(mem_bio.get_buf())), } } -- GitLab