From patchwork Sat Feb 25 13:11:46 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Weil X-Patchwork-Id: 143052 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [140.186.70.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id D8D7CB6FBA for ; Sun, 26 Feb 2012 00:12:06 +1100 (EST) Received: from localhost ([::1]:57317 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S1HPu-00014a-1S for incoming@patchwork.ozlabs.org; Sat, 25 Feb 2012 08:12:02 -0500 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 Received: from v220110690675601.yourvserver.net ([78.47.199.172]:44420) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S1HPf-0000dn-J3; Sat, 25 Feb 2012 08:11:47 -0500 Received: from localhost (v220110690675601.yourvserver.net.local [127.0.0.1]) by v220110690675601.yourvserver.net (Postfix) with ESMTP id DDBEE7280099; Sat, 25 Feb 2012 14:11:46 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at weilnetz.de Received: from v220110690675601.yourvserver.net ([127.0.0.1]) by localhost (v220110690675601.yourvserver.net [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id XoF7BU5ht7sn; Sat, 25 Feb 2012 14:11:46 +0100 (CET) Received: by v220110690675601.yourvserver.net (Postfix, from userid 1000) id 6915B728009A; Sat, 25 Feb 2012 14:11:46 +0100 (CET) From: Stefan Weil To: QEMU Trivial Date: Sat, 25 Feb 2012 14:11:46 +0100 Message-Id: <1330175506-19167-1-git-send-email-sw@weilnetz.de> X-Mailer: git-send-email 1.7.9 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 78.47.199.172 Cc: Stefan Weil , qemu-devel@nongnu.org Subject: [Qemu-devel] [PATCH] 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 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;