From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:57496) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S1HPk-000146-Ne for qemu-devel@nongnu.org; Sat, 25 Feb 2012 08:11:57 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S1HPf-0000dv-Op for qemu-devel@nongnu.org; Sat, 25 Feb 2012 08:11:52 -0500 From: Stefan Weil Date: Sat, 25 Feb 2012 14:11:46 +0100 Message-Id: <1330175506-19167-1-git-send-email-sw@weilnetz.de> Subject: [Qemu-devel] [PATCH] Fix sign of sscanf format specifiers List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: QEMU Trivial Cc: Stefan Weil , qemu-devel@nongnu.org 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 --- 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