From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:33183) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S5fPj-00007u-KN for qemu-devel@nongnu.org; Thu, 08 Mar 2012 10:38:09 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S5fPe-0001ZN-Nz for qemu-devel@nongnu.org; Thu, 08 Mar 2012 10:37:59 -0500 Received: from e06smtp14.uk.ibm.com ([195.75.94.110]:42288) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S5fPe-0001Yj-DW for qemu-devel@nongnu.org; Thu, 08 Mar 2012 10:37:54 -0500 Received: from /spool/local by e06smtp14.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 8 Mar 2012 15:37:50 -0000 Received: from d06av11.portsmouth.uk.ibm.com (d06av11.portsmouth.uk.ibm.com [9.149.37.252]) by d06nrmr1307.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id q28FbXYx2273438 for ; Thu, 8 Mar 2012 15:37:33 GMT Received: from d06av11.portsmouth.uk.ibm.com (loopback [127.0.0.1]) by d06av11.portsmouth.uk.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id q28FbWK9020294 for ; Thu, 8 Mar 2012 08:37:33 -0700 From: Stefan Hajnoczi Date: Thu, 8 Mar 2012 15:37:15 +0000 Message-Id: <1331221041-4710-6-git-send-email-stefanha@linux.vnet.ibm.com> In-Reply-To: <1331221041-4710-1-git-send-email-stefanha@linux.vnet.ibm.com> References: <1331221041-4710-1-git-send-email-stefanha@linux.vnet.ibm.com> Subject: [Qemu-devel] [PATCH 05/11] Fix sign of sscanf format specifiers List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Anthony Liguori Cc: Stefan Weil , qemu-devel@nongnu.org, Stefan Hajnoczi From: Stefan Weil 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 Signed-off-by: Stefan Hajnoczi --- 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.1