aboutsummaryrefslogtreecommitdiffstats
path: root/gtk
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2003-12-21 22:21:45 +0000
committerGuy Harris <guy@alum.mit.edu>2003-12-21 22:21:45 +0000
commitecbfe2fb775c1319a8ebead2a6dbffb502d2637d (patch)
tree2a8a49be85cfb0d85fdafd5ed7ec77ab5229d0d6 /gtk
parent9ce5cd3548b89e8ae572f7ba91cb9df0e985467b (diff)
"sizeof(array)" is the size of the array in bytes, not the number of
elements in the array. svn path=/trunk/; revision=9398
Diffstat (limited to 'gtk')
-rw-r--r--gtk/ansi_map_stat.c9
-rw-r--r--gtk/isup_stat.c8
2 files changed, 10 insertions, 7 deletions
diff --git a/gtk/ansi_map_stat.c b/gtk/ansi_map_stat.c
index 2e016f5ac6..33a5255d2e 100644
--- a/gtk/ansi_map_stat.c
+++ b/gtk/ansi_map_stat.c
@@ -5,7 +5,7 @@
*
* MUCH code modified from service_response_time_table.c.
*
- * $Id: ansi_map_stat.c,v 1.5 2003/12/17 22:13:06 guy Exp $
+ * $Id: ansi_map_stat.c,v 1.6 2003/12/21 22:21:45 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -67,11 +67,12 @@ typedef struct _ansi_map_stat_dlg_t {
char *entries[3];
} ansi_map_stat_dlg_t;
+#define N_MESSAGE_TYPES 0xff
+
typedef struct _ansi_map_stat_t {
- int message_type[0xff];
+ int message_type[N_MESSAGE_TYPES];
} ansi_map_stat_t;
-
static ansi_map_stat_dlg_t dlg;
static ansi_map_stat_t stat;
@@ -99,7 +100,7 @@ ansi_map_stat_packet(
tapdata = tapdata;
pinfo = pinfo;
- if (data_p->message_type > sizeof(stat.message_type))
+ if (data_p->message_type > N_MESSAGE_TYPES)
{
/*
* unknown PDU type !!!
diff --git a/gtk/isup_stat.c b/gtk/isup_stat.c
index d98834fff6..669e880ba0 100644
--- a/gtk/isup_stat.c
+++ b/gtk/isup_stat.c
@@ -5,7 +5,7 @@
*
* MUCH code modified from service_response_time_table.c.
*
- * $Id: isup_stat.c,v 1.5 2003/12/17 22:13:07 guy Exp $
+ * $Id: isup_stat.c,v 1.6 2003/12/21 22:21:45 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -67,8 +67,10 @@ typedef struct _isup_stat_dlg_t {
char *entries[4];
} isup_stat_dlg_t;
+#define N_MESSAGE_TYPES 0xff
+
typedef struct _isup_stat_t {
- int message_type[0xff];
+ int message_type[N_MESSAGE_TYPES];
} isup_stat_t;
@@ -99,7 +101,7 @@ isup_stat_packet(
tapdata = tapdata;
pinfo = pinfo;
- if (data_p->message_type > sizeof(stat.message_type))
+ if (data_p->message_type > N_MESSAGE_TYPES)
{
/*
* unknown message type !!!