aboutsummaryrefslogtreecommitdiffstats
path: root/epan/strutil.c
diff options
context:
space:
mode:
authorGerald Combs <gerald@wireshark.org>2004-06-06 14:29:07 +0000
committerGerald Combs <gerald@wireshark.org>2004-06-06 14:29:07 +0000
commit4a0a8b7e72424ee27fbbb0aa534eff64b59bff9b (patch)
treed8dd0933717ff6071c0baa6c4cbdd3b8479af42c /epan/strutil.c
parentd9c70dcdf6999ebea7380f8202aab4ee746517b8 (diff)
downloadwireshark-4a0a8b7e72424ee27fbbb0aa534eff64b59bff9b.tar.gz
wireshark-4a0a8b7e72424ee27fbbb0aa534eff64b59bff9b.tar.bz2
wireshark-4a0a8b7e72424ee27fbbb0aa534eff64b59bff9b.zip
Add a "force_separators" parameter to hex_str_to_bytes so that it's
possible to paste in WEP keys without any separators. Add doxygen comments to strutil.h. svn path=/trunk/; revision=11123
Diffstat (limited to 'epan/strutil.c')
-rw-r--r--epan/strutil.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/epan/strutil.c b/epan/strutil.c
index df4dade4d5..b2b72457b7 100644
--- a/epan/strutil.c
+++ b/epan/strutil.c
@@ -1,7 +1,7 @@
/* strutil.c
* String utility routines
*
- * $Id: strutil.c,v 1.20 2004/05/01 23:56:03 guy Exp $
+ * $Id: strutil.c,v 1.21 2004/06/06 14:29:07 gerald Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -316,7 +316,7 @@ is_byte_sep(guint8 c)
* is_byte_sep() into a byte array.
*/
gboolean
-hex_str_to_bytes(const char *hex_str, GByteArray *bytes) {
+hex_str_to_bytes(const char *hex_str, GByteArray *bytes, gboolean force_separators) {
guint8 val;
const guchar *p, *q, *punct;
char two_digits[3];
@@ -351,15 +351,13 @@ hex_str_to_bytes(const char *hex_str, GByteArray *bytes) {
p = punct + 1;
continue;
}
- else {
+ else if (force_separators) {
return FALSE;
break;
}
}
- else {
- p = punct;
- continue;
- }
+ p = punct;
+ continue;
}
else if (*q && isxdigit(*p) && is_byte_sep(*q)) {
one_digit[0] = *p;