From 2b56f73cfb25d704ba266014de887545a2a96b34 Mon Sep 17 00:00:00 2001 From: Marvin Scholz Date: Sun, 19 Apr 2020 04:14:07 +0200 Subject: [PATCH] Cleanup: Do not name variable same as hex function --- src/util.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/util.c b/src/util.c index c54162d1..1e11016d 100644 --- a/src/util.c +++ b/src/util.c @@ -402,17 +402,17 @@ char *util_normalise_uri(const char *uri) { char *util_bin_to_hex(unsigned char *data, int len) { - char *hex = malloc(len*2 + 1); + char *hexstr = malloc(len*2 + 1); int i; for (i = 0; i < len; i++) { - hex[i*2] = hexchars[(data[i]&0xf0) >> 4]; - hex[i*2+1] = hexchars[data[i]&0x0f]; + hexstr[i*2] = hexchars[(data[i]&0xf0) >> 4]; + hexstr[i*2+1] = hexchars[data[i]&0x0f]; } - hex[len*2] = 0; + hexstr[len*2] = 0; - return hex; + return hexstr; } /* This isn't efficient, but it doesn't need to be */