mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-12-11 16:00:50 -07:00
Use qemu_tolower() and qemu_toupper(), not tolower() and toupper()
On NetBSD, where tolower() and toupper() are implemented using an array lookup, the compiler warns if you pass a plain 'char' to these functions: gdbstub.c:914:13: warning: array subscript has type 'char' This reflects the fact that toupper() and tolower() give undefined behaviour if they are passed a value that isn't a valid 'unsigned char' or EOF. We have qemu_tolower() and qemu_toupper() to avoid this problem; use them. (The use in scsi-generic.c does not trigger the warning because it passes a uint8_t; we switch it anyway, for consistency.) Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Richard Henderson <rth@twiddle.net> Acked-by: Christian Borntraeger <borntraeger@de.ibm.com> for the s390 part. Acked-by: David Gibson <david@gibson.dropbear.id.au> Message-id: 1500568290-7966-1-git-send-email-peter.maydell@linaro.org
This commit is contained in:
parent
02ffa034fb
commit
95a5befc2f
4 changed files with 5 additions and 5 deletions
|
|
@ -911,7 +911,7 @@ static int gdb_handle_vcont(GDBState *s, const char *p)
|
|||
|
||||
cur_action = *p++;
|
||||
if (cur_action == 'C' || cur_action == 'S') {
|
||||
cur_action = tolower(cur_action);
|
||||
cur_action = qemu_tolower(cur_action);
|
||||
res = qemu_strtoul(p + 1, &p, 16, &tmp);
|
||||
if (res) {
|
||||
goto out;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue