fix str2val()

This commit is contained in:
Duncan Laurie 2005-05-15 04:51:02 +00:00
parent a567ac9426
commit f598c42e2e

View File

@ -120,12 +120,13 @@ uint16_t str2val(const char *str, const struct valstr *vs)
int i = 0;
while (vs[i].str != NULL) {
if (!strncasecmp(vs[i].str, str, strlen(str)))
if (!strncasecmp(vs[i].str, str,
__max(strlen(str), strlen(vs[i].str))))
return vs[i].val;
i++;
}
return 0;
return vs[i].val;
}
/* ipmi_csum - calculate an ipmi checksum