ID: 3608003 - 'lib/ipmi_fru.c' - atol() should be replaced with str2*()

Commit replaces atol() calls with str2int() ones in 'lib/ipmi_fru.c'.
This commit is contained in:
Zdenek Styblik 2013-06-02 12:27:41 +00:00
parent dbe514a558
commit 8489426a63

View File

@ -3558,8 +3558,16 @@ ipmi_fru_edit_multirec(struct ipmi_intf * intf, uint8_t id ,
lprintf(LOG_ERR, "oem iana <record> <format> [<args>]"); lprintf(LOG_ERR, "oem iana <record> <format> [<args>]");
error = 1; error = 1;
} else { } else {
suppliedIana = atol ( argv[3] ) ; if (str2uint(argv[3], &suppliedIana) == 0) {
lprintf(LOG_DEBUG, "using iana: %d", suppliedIana); lprintf(LOG_DEBUG,
"using iana: %d",
suppliedIana);
} else {
lprintf(LOG_ERR,
"Given IANA '%s' is invalid.",
argv[3]);
error = 1;
}
} }
} }
} }
@ -3746,8 +3754,16 @@ ipmi_fru_get_multirec(struct ipmi_intf * intf, uint8_t id ,
lprintf(LOG_ERR, "oem iana <record> <format>"); lprintf(LOG_ERR, "oem iana <record> <format>");
error = 1; error = 1;
} else { } else {
suppliedIana = atol ( argv[3] ) ; if (str2uint(argv[3], &suppliedIana) == 0) {
lprintf(LOG_DEBUG, "using iana: %d", suppliedIana); lprintf(LOG_DEBUG,
"using iana: %d",
suppliedIana);
} else {
lprintf(LOG_ERR,
"Given IANA '%s' is invalid.",
argv[3]);
error = 1;
}
} }
} }