Skip to content

Commit

Permalink
Fix regression in strerror
Browse files Browse the repository at this point in the history
Fixes #274
  • Loading branch information
nsslh committed Nov 17, 2023
1 parent 9a5c1f8 commit 1a0fe48
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/error.jl
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ function strerror(ret, bufsize=1000)
ccall((:mbedtls_strerror, libmbedcrypto), Cvoid,
(Cint, Ptr{Cvoid}, Csize_t),
ret, buf, bufsize)
resize!(buf, something(findfirst(0x00, buf), length(buf) + 1) - 1)
resize!(buf, something(findfirst(iszero, buf), length(buf) + 1) - 1)
s = String(buf)
if ret == MBEDTLS_ERR_SSL_FATAL_ALERT_MESSAGE
s *= " (You may need to enable `ssl_conf_renegotiation!`. See " *
Expand Down

0 comments on commit 1a0fe48

Please sign in to comment.