]> git.ipfire.org Git - thirdparty/u-boot.git/blobdiff - common/command.c
common: event: check event_type_name() argument
[thirdparty/u-boot.git] / common / command.c
index 7821c273daeb332416bd846b4b1553df1401b6f3..af8ffdba8f8ce1a5cfa9c50bac58a6840e73b8d3 100644 (file)
@@ -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;