From patchwork Wed Mar 7 12:44:40 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Hajnoczi X-Patchwork-Id: 145249 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id AC28CB6F62 for ; Wed, 7 Mar 2012 23:47:07 +1100 (EST) Received: from localhost ([::1]:54961 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S5GGn-0006km-Db for incoming@patchwork.ozlabs.org; Wed, 07 Mar 2012 07:47:05 -0500 Received: from eggs.gnu.org ([208.118.235.92]:34824) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S5GGJ-00064i-CP for qemu-devel@nongnu.org; Wed, 07 Mar 2012 07:46:49 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S5GFr-0002pY-Ei for qemu-devel@nongnu.org; Wed, 07 Mar 2012 07:46:34 -0500 Received: from e06smtp14.uk.ibm.com ([195.75.94.110]:59382) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S5GFr-0002op-6d for qemu-devel@nongnu.org; Wed, 07 Mar 2012 07:46:07 -0500 Received: from /spool/local by e06smtp14.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 7 Mar 2012 12:46:03 -0000 Received: from d06nrmr1806.portsmouth.uk.ibm.com (9.149.39.193) by e06smtp14.uk.ibm.com (192.168.101.144) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Wed, 7 Mar 2012 12:46:01 -0000 Received: from d06av12.portsmouth.uk.ibm.com (d06av12.portsmouth.uk.ibm.com [9.149.37.247]) by d06nrmr1806.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id q27Ck0r72388172 for ; Wed, 7 Mar 2012 12:46:00 GMT Received: from d06av12.portsmouth.uk.ibm.com (loopback [127.0.0.1]) by d06av12.portsmouth.uk.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id q27Ck0kM019658 for ; Wed, 7 Mar 2012 05:46:00 -0700 Received: from localhost (ptv01652.de.ibm.com [9.145.213.116]) by d06av12.portsmouth.uk.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id q27CjxSM019626; Wed, 7 Mar 2012 05:45:59 -0700 From: Stefan Hajnoczi To: Anthony Liguori Date: Wed, 7 Mar 2012 12:44:40 +0000 Message-Id: <1331124287-6327-7-git-send-email-stefanha@linux.vnet.ibm.com> X-Mailer: git-send-email 1.7.9.1 In-Reply-To: <1331124287-6327-1-git-send-email-stefanha@linux.vnet.ibm.com> References: <1331124287-6327-1-git-send-email-stefanha@linux.vnet.ibm.com> x-cbid: 12030712-1948-0000-0000-000001219F66 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 195.75.94.110 Cc: Stefan Weil , qemu-devel@nongnu.org, Stefan Hajnoczi Subject: [Qemu-devel] [PATCH 06/13] Fix sign of sscanf format specifiers X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org 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;