From d793b291b30831042e76e6ac0d507c2f6769012f Mon Sep 17 00:00:00 2001 From: Denis Kenzior Date: Thu, 27 Dec 2018 13:26:54 -0600 Subject: [PATCH] util: Remove decode_hex --- src/util.c | 26 -------------------------- src/util.h | 3 --- 2 files changed, 29 deletions(-) diff --git a/src/util.c b/src/util.c index c85c0be3..1ed2ce18 100644 --- a/src/util.c +++ b/src/util.c @@ -3234,32 +3234,6 @@ unsigned char *decode_hex_own_buf(const char *in, long len, long *items_written, return buf; } -unsigned char *decode_hex(const char *in, long len, long *items_written, - unsigned char terminator) -{ - long i; - char c; - unsigned char *buf; - - if (len < 0) - len = strlen(in); - - len &= ~0x1; - - for (i = 0; i < len; i++) { - c = toupper(in[i]); - - if ((c >= '0' && c <= '9') || (c >= 'A' && c <= 'F')) - continue; - - return NULL; - } - - buf = g_new(unsigned char, (len >> 1) + (terminator ? 1 : 0)); - - return decode_hex_own_buf(in, len, items_written, terminator, buf); -} - /*! * Encodes the data using hexadecimal characters. len can be negative, * in that case the terminator is used to find the last character. This is diff --git a/src/util.h b/src/util.h index df3763b1..848cc492 100644 --- a/src/util.h +++ b/src/util.h @@ -67,9 +67,6 @@ unsigned char *decode_hex_own_buf(const char *in, long len, long *items_written, unsigned char terminator, unsigned char *buf); -unsigned char *decode_hex(const char *in, long len, long *items_written, - unsigned char terminator); - char *encode_hex_own_buf(const unsigned char *in, long len, unsigned char terminator, char *buf);