Skip to content
Snippets Groups Projects
Commit 25e94b51 authored by Tobias Kahlki's avatar Tobias Kahlki Committed by Jonas Höppner
Browse files

[CMD][EEPROM] Fix arg count check

Increase min. argc to 4 (cmd, mode, bus and address). Add extra checks
to get and set functions.
parent d3609d4a
No related branches found
No related tags found
No related merge requests found
......@@ -97,7 +97,7 @@ static int do_seco_eeprom_manager(struct cmd_tbl *cmdtp, int flag, int argc, cha
printf("argv[%d]: %s\n", i, argv[i]);
#endif
if (argc < 3)
if (argc < 4)
return CMD_RET_USAGE;
i2c_bus = simple_strtoul(argv[2], &end, 0);
......@@ -105,13 +105,13 @@ static int do_seco_eeprom_manager(struct cmd_tbl *cmdtp, int flag, int argc, cha
seco_eeprom_init(i2c_bus, i2c_addr);
if (!strcmp(argv[1], "get"))
if (!strcmp(argv[1], "get") && argc == 5)
{
uid = simple_strtoul(argv[4], &end, 0);
do_seco_eeprom_manager_get(uid, false);
do_seco_eeprom_manager_get(uid, true);
}
#if DEBUG
else if (!strcmp(argv[1], "set"))
else if (!strcmp(argv[1], "set") && argc == 6)
do_seco_eeprom_manager_set(argc, &argv);
#endif
else if (!strcmp(argv[1], "env"))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment