mirror of
https://github.com/u-boot/u-boot.git
synced 2025-04-16 01:44:34 +00:00
cmd: ini: Fix build warning
Building U-Boot with CMD_INI=y result in following build warning: cmd/ini.c: In function 'memgets': include/linux/kernel.h:184:24: warning: comparison of distinct pointer types lacks a cast 184 | (void) (&_min1 == &_min2); \ | ^~ cmd/ini.c:92:15: note: in expansion of macro 'min' 92 | len = min((end - *mem) + newline, num); | ^~~ Fix this by adding an int cast to the pointer arithmetic result. Signed-off-by: Jonas Karlman <jonas@kwiboo.se> Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
This commit is contained in:
parent
7af6616c96
commit
8c1bb04b56
1 changed files with 1 additions and 1 deletions
|
@ -89,7 +89,7 @@ static char *memgets(char *str, int num, char **mem, size_t *memsize)
|
|||
end = *mem + *memsize;
|
||||
newline = 0;
|
||||
}
|
||||
len = min((end - *mem) + newline, num);
|
||||
len = min((int)(end - *mem) + newline, num);
|
||||
memcpy(str, *mem, len);
|
||||
if (len < num)
|
||||
str[len] = '\0';
|
||||
|
|
Loading…
Add table
Reference in a new issue