aboutsummaryrefslogtreecommitdiffstats
path: root/epan
diff options
context:
space:
mode:
authorjake <jake@f5534014-38df-0310-8fa8-9805f1628bb7>2010-01-23 18:21:04 +0000
committerjake <jake@f5534014-38df-0310-8fa8-9805f1628bb7>2010-01-23 18:21:04 +0000
commit682f9efb1852b9390b87d3ecaa8dd9c2e2d77cb4 (patch)
tree48b61bd3d255e38bb94291a28c400d3c9637540d /epan
parente5db98ec731ad7308c9053bcd430d625a3352320 (diff)
Fix for bug 3898:
Get the states string sorted out. Still room for improvements though... git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@31635 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'epan')
-rw-r--r--epan/dissectors/packet-cpha.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/epan/dissectors/packet-cpha.c b/epan/dissectors/packet-cpha.c
index 88009c5561..5591a5e33d 100644
--- a/epan/dissectors/packet-cpha.c
+++ b/epan/dissectors/packet-cpha.c
@@ -145,12 +145,8 @@ static const char *opcode_type_str_long[NUM_OPCODE_TYPES+1] = {
"New Sync packet"
};
-/* XXX: Array below found by Lint to be missing an initializer. */
-/* So: "Unknown" added as the first initializer so that */
-/* this array is similar to opcode_type_str_long & etc */
#define NUM_STATES 5
-static const char *state_str[NUM_STATES+1] = {
- "Unknown",
+static const char *state_str[NUM_STATES] = {
"Down/Dead",
"Initializing",
"Standby",
@@ -466,9 +462,9 @@ ha_mode2str(guint16 hamode) {
static const char *
state2str(guint8 state) {
- if(state <= NUM_STATES)
+ if(state < NUM_STATES)
return state_str[state];
- return state_str[0];
+ return "Unknown";
}