Skip to content

Commit 970d576

Browse files
committed
const correct ossl_bin2hex()
This helper only reads from its in parameter. Making that const avoids a couple of casts in an upcoming change.
1 parent 77f730c commit 970d576

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

ext/openssl/ossl.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ ossl_buf2str(char *buf, int len)
122122
}
123123

124124
void
125-
ossl_bin2hex(unsigned char *in, char *out, size_t inlen)
125+
ossl_bin2hex(const unsigned char *in, char *out, size_t inlen)
126126
{
127127
const char *hex = "0123456789abcdef";
128128
size_t i;

ext/openssl/ossl.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ do{\
131131
* Convert binary string to hex string. The caller is responsible for
132132
* ensuring out has (2 * len) bytes of capacity.
133133
*/
134-
void ossl_bin2hex(unsigned char *in, char *out, size_t len);
134+
void ossl_bin2hex(const unsigned char *in, char *out, size_t len);
135135

136136
/*
137137
* Our default PEM callback

0 commit comments

Comments
 (0)