mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-03 07:43:54 -06:00
Fix missing strnlen problems
Fix missing strnlen (a GNU extension) problems by using qemu_strnlen used for user emulators also for system emulators. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
This commit is contained in:
parent
57a943c41f
commit
d43277c534
5 changed files with 15 additions and 23 deletions
13
cutils.c
13
cutils.c
|
@ -109,6 +109,19 @@ int stristart(const char *str, const char *val, const char **ptr)
|
|||
return 1;
|
||||
}
|
||||
|
||||
/* XXX: use host strnlen if available ? */
|
||||
int qemu_strnlen(const char *s, int max_len)
|
||||
{
|
||||
int i;
|
||||
|
||||
for(i = 0; i < max_len; i++) {
|
||||
if (s[i] == '\0') {
|
||||
break;
|
||||
}
|
||||
}
|
||||
return i;
|
||||
}
|
||||
|
||||
time_t mktimegm(struct tm *tm)
|
||||
{
|
||||
time_t t;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue