Use bounded string functions.
The bounds add a bit of safety in avoiding memory bugs and there are
sensible bounds in the cases we have been using them.
Change-Id: I381e122f356a54e5c0f1e183e521169522bc8aa9
diff --git a/test/hftest/linux_main.c b/test/hftest/linux_main.c
index 2ebe91b..0232665 100644
--- a/test/hftest/linux_main.c
+++ b/test/hftest/linux_main.c
@@ -29,6 +29,8 @@
void test_main(int argc, const char *argv[])
{
+ static const char json_command[] = "json";
+ static const char run_command[] = "run";
const char *command;
if (argc < 2) {
@@ -39,12 +41,12 @@
hftest_use_registered_list();
- if (strcmp(command, "json") == 0) {
+ if (strncmp(command, json_command, sizeof(json_command)) == 0) {
hftest_json();
return;
}
- if (strcmp(command, "run") == 0) {
+ if (strncmp(command, run_command, sizeof(run_command)) == 0) {
struct memiter suite_name;
struct memiter test_name;