Make delim const

This commit is contained in:
Nils O. Selåsdal
2013-12-08 22:28:25 +01:00
parent f6badb41a2
commit 6891a77ba9
2 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -36,7 +36,7 @@ uint8_t* uc_hex_decode(const char *in, size_t maxlen,uint8_t *out);
/** As uc_hex_encode , but inserts the @delim string between each converted /** As uc_hex_encode , but inserts the @delim string between each converted
* byte (each 2 hex chars) * byte (each 2 hex chars)
*/ */
char* uc_hex_encode_delim(const uint8_t *in, size_t inlen, char *out, int outlen, char *delim); char* uc_hex_encode_delim(const uint8_t *in, size_t inlen, char *out, int outlen, const char *delim);
/** /**
* Convert the string to lowercase, calls tolower() on each char. * Convert the string to lowercase, calls tolower() on each char.
+2 -2
View File
@@ -28,14 +28,14 @@ uc_hex_encode(const uint8_t *in, size_t len, char *out)
} }
char* char*
uc_hex_encode_delim(const uint8_t *in, size_t inlen, char *out, int outlen, char *delim) uc_hex_encode_delim(const uint8_t *in, size_t inlen, char *out, int outlen, const char *delim)
{ {
size_t i; size_t i;
char *outp = out; char *outp = out;
for (i = 0; i < inlen; i++) { for (i = 0; i < inlen; i++) {
unsigned int hn, ln; unsigned int hn, ln;
char *delimp = delim; const char *delimp = delim;
/** Truncate at a full byte */ /** Truncate at a full byte */
if (outlen <= 2) { if (outlen <= 2) {