aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2019-07-24 13:12:16 -0700
committerGuy Harris <guy@alum.mit.edu>2019-07-24 20:37:55 +0000
commit3e01632a684b5c4d1c7026929cbba6d664e56c84 (patch)
tree21ef1ec0181e3e65a9013d530d2707e99c09309e
parent4b336cefea3162ecfdb220cc316210462d6e19f4 (diff)
Use g_ascii_isalpha(), not is_rfc2234_alpha().
Use GLib's locale-independent "is this alphabetic?" routine, rather than rolling our own. Change-Id: I841de09d534867ec7510bd680fd97387719b2850 Reviewed-on: https://code.wireshark.org/review/34075 Petri-Dish: Guy Harris <guy@alum.mit.edu> Tested-by: Petri Dish Buildbot Reviewed-by: Guy Harris <guy@alum.mit.edu>
-rw-r--r--epan/dissectors/packet-mgcp.c25
1 files changed, 3 insertions, 22 deletions
diff --git a/epan/dissectors/packet-mgcp.c b/epan/dissectors/packet-mgcp.c
index 96b62606e9..77b1f76901 100644
--- a/epan/dissectors/packet-mgcp.c
+++ b/epan/dissectors/packet-mgcp.c
@@ -407,7 +407,6 @@ mgcpstat_packet(void *pms, packet_info *pinfo, epan_dissect_t *edt _U_, const vo
*/
static gint tvb_find_null_line(tvbuff_t* tvb, gint offset, gint len, gint* next_offset);
static gint tvb_find_dot_line(tvbuff_t* tvb, gint offset, gint len, gint* next_offset);
-static gboolean is_rfc2234_alpha(guint8 c);
static dissector_handle_t sdp_handle;
static dissector_handle_t mgcp_handle;
@@ -697,8 +696,8 @@ static gboolean is_mgcp_verb(tvbuff_t *tvb, gint offset, gint maxlength, const g
((g_ascii_strncasecmp(word, "AUCX", 4) == 0) && (*verb_name = "AuditConnection")) ||
((g_ascii_strncasecmp(word, "RSIP", 4) == 0) && (*verb_name = "RestartInProgress")) ||
((g_ascii_strncasecmp(word, "MESG", 4) == 0) && (*verb_name = "Message")) ||
- (word[0] == 'X' && is_rfc2234_alpha(word[1]) && is_rfc2234_alpha(word[2]) &&
- is_rfc2234_alpha(word[3]) && (*verb_name = "*Experimental*")))
+ (word[0] == 'X' && g_ascii_isalpha(word[1]) && g_ascii_isalpha(word[2]) &&
+ g_ascii_isalpha(word[3]) && (*verb_name = "*Experimental*")))
{
returnvalue = TRUE;
}
@@ -764,24 +763,6 @@ static gboolean is_mgcp_rspcode(tvbuff_t *tvb, gint offset, gint maxlength)
}
/*
- * is_rfc2234_alpha - Indicates whether the character c is an alphabetical
- * character. This function is used instead of
- * isalpha because isalpha may deviate from the rfc2234
- * definition of ALPHA in some locales.
- *
- * Parameter:
- * c - The character being checked for being an alphabetical character.
- *
- * Return: TRUE if c is an upper or lower case alphabetical character,
- * FALSE otherwise.
- */
-static gboolean is_rfc2234_alpha(guint8 c)
-{
- return ((c <= 'Z' && c >= 'A' ) || (c <= 'z' && c >= 'a'));
-}
-
-
-/*
* tvb_parse_param - Parse the MGCP param into a type and a value.
*
* Parameters:
@@ -902,7 +883,7 @@ static gint tvb_parse_param(tvbuff_t* tvb, gint offset, gint len, int** hf, mgcp
/* Keep going, through possible vendor param name */
for (counter = 1;
((len > (counter + tvb_current_offset-offset)) &&
- (is_rfc2234_alpha(tempchar = tvb_get_guint8(tvb, tvb_current_offset+counter)) ||
+ (g_ascii_isalpha(tempchar = tvb_get_guint8(tvb, tvb_current_offset+counter)) ||
g_ascii_isdigit(tempchar))) ;
counter++);