* [Qemu-devel] [PATCH] Fix sign of sscanf format specifiers
@ 2012-02-25 13:11 Stefan Weil
2012-03-05 13:12 ` Stefan Hajnoczi
0 siblings, 1 reply; 2+ messages in thread
From: Stefan Weil @ 2012-02-25 13:11 UTC (permalink / raw)
To: QEMU Trivial; +Cc: Stefan Weil, qemu-devel
All values read by sscanf are unsigned, so replace %d by %u.
This signed / unsigned mismatch was detected by splint.
Signed-off-by: Stefan Weil <sw@weilnetz.de>
---
cursor.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/cursor.c b/cursor.c
index efc5917..76e262c 100644
--- a/cursor.c
+++ b/cursor.c
@@ -15,7 +15,8 @@ static QEMUCursor *cursor_parse_xpm(const char *xpm[])
uint8_t idx;
/* parse header line: width, height, #colors, #chars */
- if (sscanf(xpm[line], "%d %d %d %d", &width, &height, &colors, &chars) != 4) {
+ if (sscanf(xpm[line], "%u %u %u %u",
+ &width, &height, &colors, &chars) != 4) {
fprintf(stderr, "%s: header parse error: \"%s\"\n",
__FUNCTION__, xpm[line]);
return NULL;
--
1.7.9
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [Qemu-devel] [PATCH] Fix sign of sscanf format specifiers
2012-02-25 13:11 [Qemu-devel] [PATCH] Fix sign of sscanf format specifiers Stefan Weil
@ 2012-03-05 13:12 ` Stefan Hajnoczi
0 siblings, 0 replies; 2+ messages in thread
From: Stefan Hajnoczi @ 2012-03-05 13:12 UTC (permalink / raw)
To: Stefan Weil; +Cc: QEMU Trivial, qemu-devel
On Sat, Feb 25, 2012 at 02:11:46PM +0100, Stefan Weil wrote:
> All values read by sscanf are unsigned, so replace %d by %u.
>
> This signed / unsigned mismatch was detected by splint.
>
> Signed-off-by: Stefan Weil <sw@weilnetz.de>
> ---
> cursor.c | 3 ++-
> 1 files changed, 2 insertions(+), 1 deletions(-)
Thanks, applied to the trivial patches tree:
https://github.com/stefanha/qemu/commits/trivial-patches
Stefan
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2012-03-05 13:12 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-02-25 13:11 [Qemu-devel] [PATCH] Fix sign of sscanf format specifiers Stefan Weil
2012-03-05 13:12 ` Stefan Hajnoczi
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).