[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[qemu-s390x] [PATCH v3 05/25] gdbstub: Use size_t for strlen() return va
From: |
Philippe Mathieu-Daudé |
Subject: |
[qemu-s390x] [PATCH v3 05/25] gdbstub: Use size_t for strlen() return value |
Date: |
Wed, 20 Feb 2019 02:02:12 +0100 |
Since strlen() returns an unsigned value, it is pointless to
convert it to a signed one. Use size_t to hold its return value.
Signed-off-by: Philippe Mathieu-Daudé <address@hidden>
---
gdbstub.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/gdbstub.c b/gdbstub.c
index bc774ae992..76eca3bb7e 100644
--- a/gdbstub.c
+++ b/gdbstub.c
@@ -1693,7 +1693,7 @@ static int gdb_handle_packet(GDBState *s, const char
*line_buf)
}
#else /* !CONFIG_USER_ONLY */
else if (strncmp(p, "Rcmd,", 5) == 0) {
- int len = strlen(p + 5);
+ size_t len = strlen(p + 5);
if ((len % 2) != 0) {
put_packet(s, "E01");
--
2.20.1
- Re: [qemu-s390x] [PATCH v3 07/25] gdbstub: Let put_buffer() use size_t, (continued)
- [qemu-s390x] [PATCH v3 06/25] gdbstub: Use size_t to hold GDBState::last_packet_len, Philippe Mathieu-Daudé, 2019/02/19
- [qemu-s390x] [RFC PATCH v3 13/25] xen: Let buffer_append() return a size_t, Philippe Mathieu-Daudé, 2019/02/19
- [qemu-s390x] [PATCH v3 11/25] xen: Let xencons_send() take a 'size' argument, Philippe Mathieu-Daudé, 2019/02/19
- [qemu-s390x] [PATCH v3 08/25] ui/gtk: Remove pointless cast, Philippe Mathieu-Daudé, 2019/02/19
- [qemu-s390x] [PATCH v3 05/25] gdbstub: Use size_t for strlen() return value,
Philippe Mathieu-Daudé <=
- [qemu-s390x] [PATCH v3 03/25] chardev/wctablet: Use unsigned type to hold unsigned value, Philippe Mathieu-Daudé, 2019/02/19
- [qemu-s390x] [PATCH v3 02/25] chardev: Assert IOCanReadHandler can not be negative, Philippe Mathieu-Daudé, 2019/02/19
- [qemu-s390x] [PATCH v3 01/25] chardev: Simplify IOWatchPoll::fd_can_read as a GSourceFunc, Philippe Mathieu-Daudé, 2019/02/19