[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Xen-devel] [PATCH v3 05/25] gdbstub: Use size_t for strlen() return value
- To: qemu-devel@xxxxxxxxxx, Prasad J Pandit <pjp@xxxxxxxxxxxxxxxxx>, Marc-André Lureau <marcandre.lureau@xxxxxxxxxx>, Paolo Bonzini <pbonzini@xxxxxxxxxx>
- From: Philippe Mathieu-Daudé <philmd@xxxxxxxxxx>
- Date: Wed, 20 Feb 2019 02:02:12 +0100
- Cc: Corey Minyard <minyard@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Samuel Thibault <samuel.thibault@xxxxxxxxxxxx>, Li Zhijian <lizhijian@xxxxxxxxxxxxxx>, Amit Shah <amit@xxxxxxxxxx>, "Michael S. Tsirkin" <mst@xxxxxxxxxx>, Jason Wang <jasowang@xxxxxxxxxx>, Cornelia Huck <cohuck@xxxxxxxxxx>, Halil Pasic <pasic@xxxxxxxxxxxxx>, Christian Borntraeger <borntraeger@xxxxxxxxxx>, qemu-s390x@xxxxxxxxxx, Paul Durrant <paul.durrant@xxxxxxxxxx>, qemu-ppc@xxxxxxxxxx, Gerd Hoffmann <kraxel@xxxxxxxxxx>, Pavel Dovgalyuk <pavel.dovgaluk@xxxxxxxxx>, Zhang Chen <zhangckid@xxxxxxxxx>, Anthony Perard <anthony.perard@xxxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx, Stefan Berger <stefanb@xxxxxxxxxxxxx>, Philippe Mathieu-Daudé <philmd@xxxxxxxxxx>, David Gibson <david@xxxxxxxxxxxxxxxxxxxxx>
- Delivery-date: Wed, 20 Feb 2019 01:04:59 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
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é <philmd@xxxxxxxxxx>
---
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
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel
|