mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-07-27 04:13:53 -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
|
@ -37,17 +37,6 @@ abi_long copy_to_user(abi_ulong gaddr, void *hptr, size_t len)
|
|||
return ret;
|
||||
}
|
||||
|
||||
/* XXX: use host strnlen if available ? */
|
||||
static 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;
|
||||
}
|
||||
|
||||
/* Return the length of a string in target memory or -TARGET_EFAULT if
|
||||
access error */
|
||||
abi_long target_strlen(abi_ulong guest_addr1)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue