util: Remove decode_hex

This commit is contained in:
Denis Kenzior 2018-12-27 13:26:54 -06:00
parent f7d8edeaac
commit d793b291b3
2 changed files with 0 additions and 29 deletions

View File

@ -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

View File

@ -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);