From patchwork Thu Mar 8 15:37:15 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Hajnoczi X-Patchwork-Id: 145569 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 69AE5B6EEC for ; Fri, 9 Mar 2012 03:16:42 +1100 (EST) Received: from localhost ([::1]:57720 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S5fQ8-0000jM-IH for incoming@patchwork.ozlabs.org; Thu, 08 Mar 2012 10:38:24 -0500 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 d06nrmr1307.portsmouth.uk.ibm.com (9.149.38.129) by e06smtp14.uk.ibm.com (192.168.101.144) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Thu, 8 Mar 2012 15:37:34 -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 Received: from localhost (stefanha-thinkpad.manchester-maybrook.uk.ibm.com [9.174.219.44]) by d06av11.portsmouth.uk.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id q28FbWDf020275; Thu, 8 Mar 2012 08:37:32 -0700 From: Stefan Hajnoczi To: Anthony Liguori Date: Thu, 8 Mar 2012 15:37:15 +0000 Message-Id: <1331221041-4710-6-git-send-email-stefanha@linux.vnet.ibm.com> X-Mailer: git-send-email 1.7.9.1 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> x-cbid: 12030815-1948-0000-0000-0000012522D2 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 05/11] 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;