From 6891a77ba9eb9a7b642aac4a78fb9f3fdbbe331f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nils=20O=2E=20Sel=C3=A5sdal?= Date: Sun, 8 Dec 2013 22:28:25 +0100 Subject: [PATCH] Make delim const --- include/ucore/string.h | 2 +- src/hex.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/ucore/string.h b/include/ucore/string.h index eb5e3ee..4225a2a 100644 --- a/include/ucore/string.h +++ b/include/ucore/string.h @@ -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 * 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. diff --git a/src/hex.c b/src/hex.c index e361856..b2a162d 100644 --- a/src/hex.c +++ b/src/hex.c @@ -28,14 +28,14 @@ uc_hex_encode(const uint8_t *in, size_t len, char *out) } 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; char *outp = out; for (i = 0; i < inlen; i++) { unsigned int hn, ln; - char *delimp = delim; + const char *delimp = delim; /** Truncate at a full byte */ if (outlen <= 2) {