MbedTLS: Make error string printing prettier.

This commit is contained in:
Aaron Jones 2016-09-15 11:55:00 +00:00
parent db12df5c16
commit 8cd8b24ffb
No known key found for this signature in database
GPG key ID: EC6F86EE9CD840B5

View file

@ -295,7 +295,7 @@ rb_ssl_strerror(int err)
#ifdef MBEDTLS_ERROR_C #ifdef MBEDTLS_ERROR_C
char mbed_errbuf[512]; char mbed_errbuf[512];
mbedtls_strerror(err, mbed_errbuf, sizeof mbed_errbuf); mbedtls_strerror(err, mbed_errbuf, sizeof mbed_errbuf);
(void) rb_snprintf(errbuf, sizeof errbuf, "(-0x%x) %s", -err, mbed_errbuf); (void) rb_snprintf(errbuf, sizeof errbuf, "-0x%x: %s", -err, mbed_errbuf);
#else #else
(void) rb_snprintf(errbuf, sizeof errbuf, "-0x%x", -err); (void) rb_snprintf(errbuf, sizeof errbuf, "-0x%x", -err);
#endif #endif