metex14: Fix 'is_ol' handling.

Thanks to Bert Vermeulen for the reminder.
This commit is contained in:
Uwe Hermann 2012-12-01 20:11:40 +01:00
parent 2477fb9569
commit 8f46911e42
1 changed files with 4 additions and 4 deletions

View File

@ -61,10 +61,10 @@ static int parse_value(const uint8_t *buf, float *result)
/* Bytes 5-7: Over limit (various forms) */
is_ol = 0;
is_ol += !strncmp((char *)&buf[5], ".OL", 3);
is_ol += !strncmp((char *)&buf[5], "O.L", 3);
is_ol += !strncmp((char *)&buf[5], "OL.", 3);
is_ol += !strncmp((char *)&buf[5], " OL", 3);
is_ol += (!strncmp((char *)&buf[5], ".OL", 3)) ? 1 : 0;
is_ol += (!strncmp((char *)&buf[5], "O.L", 3)) ? 1 : 0;
is_ol += (!strncmp((char *)&buf[5], "OL.", 3)) ? 1 : 0;
is_ol += (!strncmp((char *)&buf[5], " OL", 3)) ? 1 : 0;
if (is_ol != 0) {
sr_spew("Over limit.");
*result = INFINITY;