aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-ssl-utils.c
diff options
context:
space:
mode:
authorJakub Zawadzki <darkjames-ws@darkjames.pl>2014-01-08 00:28:13 +0000
committerJakub Zawadzki <darkjames-ws@darkjames.pl>2014-01-08 00:28:13 +0000
commitd28084d1839bb581229f72acc37608b00c2caba7 (patch)
treefb6ba22256d5334b83e0279879544f28efcb8601 /epan/dissectors/packet-ssl-utils.c
parente8dd800cc16765afadc8543ed9292ea5caf73df1 (diff)
Move UAT xton() to wsutil library
Use ws_xton() in few more places. svn path=/trunk/; revision=54642
Diffstat (limited to 'epan/dissectors/packet-ssl-utils.c')
-rw-r--r--epan/dissectors/packet-ssl-utils.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/epan/dissectors/packet-ssl-utils.c b/epan/dissectors/packet-ssl-utils.c
index cd3a79a20a..bb04e00ee6 100644
--- a/epan/dissectors/packet-ssl-utils.c
+++ b/epan/dissectors/packet-ssl-utils.c
@@ -42,6 +42,7 @@
#include <epan/ipv6-utils.h>
#include <epan/expert.h>
#include <wsutil/file_util.h>
+#include <wsutil/str_util.h>
/*
* Lookup tables
@@ -1356,6 +1357,7 @@ ssl_data_set(StringInfo* str, const guchar* data, guint len)
static guint8
from_hex_char(gchar c) {
+ /* XXX, ws_xton() */
if ((c >= '0') && (c <= '9'))
return c - '0';
if ((c >= 'A') && (c <= 'F'))
@@ -1377,9 +1379,9 @@ static gboolean from_hex(StringInfo* out, const char* in, gsize hex_len) {
out->data_len = (guint)hex_len/2;
out->data = (guchar *)wmem_alloc(wmem_file_scope(), out->data_len);
for (i = 0; i < out->data_len; i++) {
- guint8 a = from_hex_char(in[i*2]);
- guint8 b = from_hex_char(in[i*2 + 1]);
- if (a == 16 || b == 16)
+ int a = ws_xton(in[i*2]);
+ int b = ws_xton(in[i*2 + 1]);
+ if (a == -1 || b == -1)
return FALSE;
out->data[i] = a << 4 | b;
}