diff options
author | Jaap Keuter <jaap.keuter@xs4all.nl> | 2010-01-23 18:21:04 +0000 |
---|---|---|
committer | Jaap Keuter <jaap.keuter@xs4all.nl> | 2010-01-23 18:21:04 +0000 |
commit | 9ab6dcc0b9c4b63b4ee1012d52dfcd294653b210 (patch) | |
tree | 48b61bd3d255e38bb94291a28c400d3c9637540d /epan/dissectors/packet-cpha.c | |
parent | 7049fa56788886eb32f5af8971bcdd80e8b0b305 (diff) |
Fix for bug 3898:
Get the states string sorted out. Still room for improvements though...
svn path=/trunk/; revision=31635
Diffstat (limited to 'epan/dissectors/packet-cpha.c')
-rw-r--r-- | epan/dissectors/packet-cpha.c | 10 |
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"; } |