summaryrefslogtreecommitdiff
path: root/common/command.c
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2024-01-17 09:12:27 -0500
committerTom Rini <trini@konsulko.com>2024-01-17 09:12:27 -0500
commit106332d6cc583c4339e07020989d09b567900a59 (patch)
tree746beb976633e80b5c824805100490bb51cb9ffb /common/command.c
parent043ca8c8a9b181cf6f17441e9b89b5ee33206309 (diff)
parenta300ac3851440906a3934915bd12db2b96987a6a (diff)
Merge branch '2024-01-16-assorted-updates-and-improvements'
- Add more pytests to exercise functionality on real hardware, cleanup and add tests around "cp"/memmove, add phyCORE-AM62x and Phytium Pe2201 platforms, Nuvoton NPCM BMC reset driver and improve QEMU SMBIOS support
Diffstat (limited to 'common/command.c')
-rw-r--r--common/command.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/common/command.c b/common/command.c
index 7821c273dae..af8ffdba8f8 100644
--- a/common/command.c
+++ b/common/command.c
@@ -465,12 +465,12 @@ int cmd_auto_complete(const char *const prompt, char *buf, int *np, int *colp)
#endif
#ifdef CMD_DATA_SIZE
-int cmd_get_data_size(char* arg, int default_size)
+int cmd_get_data_size(const char *arg, int default_size)
{
/* Check for a size specification .b, .w or .l.
*/
int len = strlen(arg);
- if (len > 2 && arg[len-2] == '.') {
+ if (len >= 2 && arg[len-2] == '.') {
switch (arg[len-1]) {
case 'b':
return 1;