aboutsummaryrefslogtreecommitdiffstats
path: root/epan
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2014-10-16 18:21:20 -0700
committerGuy Harris <guy@alum.mit.edu>2014-10-17 01:21:48 +0000
commit359a32f735230a5103498d21bbb6ebf9372c88b0 (patch)
treeb1e0278611fca388c73eca985ae1c1582c755423 /epan
parente6fcff1eb62b581eb7fb3d7af1d2e38612a00b30 (diff)
No need for our own wrappers around tolower() and toupper().
We can just use g_ascii_tolower() and g_ascii_toupper(); Change-Id: I8a88a096d16ce8c60dd9151e5bdddf6747702145 Reviewed-on: https://code.wireshark.org/review/4754 Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'epan')
-rw-r--r--epan/dfilter/dfunctions.c23
1 files changed, 3 insertions, 20 deletions
diff --git a/epan/dfilter/dfunctions.c b/epan/dfilter/dfunctions.c
index eef35e8f81..0ce74faaae 100644
--- a/epan/dfilter/dfunctions.c
+++ b/epan/dfilter/dfunctions.c
@@ -26,29 +26,12 @@
#include "dfilter-int.h"
#include <string.h>
-#include <ctype.h>
#include <ftypes/ftypes-int.h>
#include <ftypes/ftypes.h>
#include <epan/exceptions.h>
#include <epan/emem.h>
-/* lowercase an ASCII character.
- * (thanks to Guy Harris for the function) */
-static gchar
-string_ascii_to_lower(gchar c)
-{
- return ((c & 0x80) ? c : tolower(c));
-}
-
-/* uppercase an ASCII character. */
-static gchar
-string_ascii_to_upper(gchar c)
-{
- return ((c & 0x80) ? c : toupper(c));
-}
-
-
/* Convert an FT_STRING using a callback function */
static gboolean
string_walk(GList* arg1list, GList **retval, gchar(*conv_func)(gchar))
@@ -65,7 +48,7 @@ string_walk(GList* arg1list, GList **retval, gchar(*conv_func)(gchar))
if (IS_FT_STRING(fvalue_type_ftenum(arg_fvalue))) {
s = (char *)ep_strdup((gchar *)fvalue_get(arg_fvalue));
for (c = s; *c; c++) {
- /**c = string_ascii_to_lower(*c);*/
+ /**c = g_ascii_tolower(*c);*/
*c = conv_func(*c);
}
@@ -83,14 +66,14 @@ string_walk(GList* arg1list, GList **retval, gchar(*conv_func)(gchar))
static gboolean
df_func_lower(GList* arg1list, GList *arg2junk _U_, GList **retval)
{
- return string_walk(arg1list, retval, string_ascii_to_lower);
+ return string_walk(arg1list, retval, g_ascii_tolower);
}
/* dfilter function: upper() */
static gboolean
df_func_upper(GList* arg1list, GList *arg2junk _U_, GList **retval)
{
- return string_walk(arg1list, retval, string_ascii_to_upper);
+ return string_walk(arg1list, retval, g_ascii_toupper);
}
/* dfilter function: len() */