diff options
author | Andrew Elder <aelder@audioscience.com> | 2013-08-15 17:04:45 -0400 |
---|---|---|
committer | Andrew Elder <aelder@audioscience.com> | 2013-08-15 17:06:42 -0400 |
commit | 68ea6f2341da0054006a8a5278fbd24d161e1101 (patch) | |
tree | 86d67a7f682e0992d06539e3d0e1766f7c17a767 /examples/mrp_client | |
parent | 1124144db7d0d1ceb8b426768bda705d98ffd9fa (diff) | |
download | Open-AVB-68ea6f2341da0054006a8a5278fbd24d161e1101.tar.gz |
MRP: mrp_client: mrpdhelper: bugfix in application state string compare in parse_app_state()
Diffstat (limited to 'examples/mrp_client')
-rwxr-xr-x | examples/mrp_client/mrpdhelper.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/examples/mrp_client/mrpdhelper.c b/examples/mrp_client/mrpdhelper.c index 0756da75..ccd1d428 100755 --- a/examples/mrp_client/mrpdhelper.c +++ b/examples/mrp_client/mrpdhelper.c @@ -53,10 +53,12 @@ and parses them into a machine readable structure. #include "mrpdhelper.h" +#define MRPD_N_APP_STATE_STRINGS 13 + struct app_state_to_enum { char *s; enum mrpdhelper_applicant_state value; -} mrp_app_state_mapping[13] = { +} mrp_app_state_mapping[MRPD_N_APP_STATE_STRINGS] = { {"nl", mrpdhelper_applicant_state_null}, {"VO", mrpdhelper_applicant_state_VO}, {"VP", mrpdhelper_applicant_state_VP}, @@ -87,7 +89,7 @@ static int parse_app_state(char *sz, struct mrpdhelper_notify *n) sz = r + 1; /* loop over mrp_app_state_mapping struct */ - for (i=0; i < 12; i++) { + for (i=0; i < MRPD_N_APP_STATE_STRINGS; i++) { if (strncmp(sz, mrp_app_state_mapping[i].s, 2) == 0) { n->app_state = mrp_app_state_mapping[i].value; break; |