diff options
author | Andrew Elder <aelder@audioscience.com> | 2013-08-15 17:04:45 -0400 |
---|---|---|
committer | Andrew Elder <aelder@audioscience.com> | 2013-08-19 16:11:51 -0400 |
commit | 04b891e93b6e4417f4fe5b1e8c3a8f55519909c3 (patch) | |
tree | 83b512f3f4b00d56b9ead608f75e61d45976c52a /examples/mrp_client | |
parent | ebbb9153a9ae65d23e8d84e8971c00072d5ea767 (diff) | |
download | Open-AVB-04b891e93b6e4417f4fe5b1e8c3a8f55519909c3.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 9a26ca7b..707d4e97 100755 --- a/examples/mrp_client/mrpdhelper.c +++ b/examples/mrp_client/mrpdhelper.c @@ -49,10 +49,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}, @@ -83,7 +85,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; |