Write "error" when there is an error.

This commit is contained in:
Jacob Hoffman-Andrews 2020-06-01 18:29:50 -07:00
parent 1aff5b9198
commit 01e229346c
1 changed files with 2 additions and 2 deletions

View File

@ -68,7 +68,7 @@ impl fmt::Display for Asn1GeneralizedTimeRef {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
unsafe { unsafe {
let mem_bio = match MemBio::new() { let mem_bio = match MemBio::new() {
Err(_) => return f.write_str(""), Err(_) => return f.write_str("error"),
Ok(m) => m, Ok(m) => m,
}; };
let print_result = cvt(ffi::ASN1_GENERALIZEDTIME_print( let print_result = cvt(ffi::ASN1_GENERALIZEDTIME_print(
@ -76,7 +76,7 @@ impl fmt::Display for Asn1GeneralizedTimeRef {
self.as_ptr(), self.as_ptr(),
)); ));
match print_result { match print_result {
Err(_) => f.write_str(""), Err(_) => f.write_str("error"),
Ok(_) => f.write_str(str::from_utf8_unchecked(mem_bio.get_buf())), Ok(_) => f.write_str(str::from_utf8_unchecked(mem_bio.get_buf())),
} }
} }