From patchwork Thu Apr 3 21:01:15 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Cercueil X-Patchwork-Id: 336778 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from silver.osuosl.org (silver.osuosl.org [140.211.166.136]) by ozlabs.org (Postfix) with ESMTP id BB2B9140095 for ; Fri, 4 Apr 2014 08:02:50 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 06C0031CED; Thu, 3 Apr 2014 21:02:50 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ACUQy7stLaQt; Thu, 3 Apr 2014 21:02:46 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by silver.osuosl.org (Postfix) with ESMTP id 4105831C4B; Thu, 3 Apr 2014 21:02:31 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from whitealder.osuosl.org (whitealder.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id 7A9DE1C1E95 for ; Thu, 3 Apr 2014 21:02:23 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 77ECB8C828 for ; Thu, 3 Apr 2014 21:02:23 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id djMwu9DVsaaT for ; Thu, 3 Apr 2014 21:02:23 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from marvin.crapouillou.net (rev33.vpn.fdn.fr [80.67.179.33]) by whitealder.osuosl.org (Postfix) with ESMTPS id E1F398C827 for ; Thu, 3 Apr 2014 21:02:22 +0000 (UTC) Received: from 95-91-234-117-dynip.superkabel.de ([95.91.234.117] helo=debian.hitronhub.home) by marvin.crapouillou.net with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA256:128) (Exim 4.80) (envelope-from ) id 1WVom7-00045j-TB; Thu, 03 Apr 2014 23:02:16 +0200 From: Paul Cercueil To: buildroot@busybox.net Date: Thu, 3 Apr 2014 23:01:15 +0200 Message-Id: <1396558881-29631-5-git-send-email-paul@crapouillou.net> X-Mailer: git-send-email 1.9.0 In-Reply-To: <1396558881-29631-1-git-send-email-paul@crapouillou.net> References: <1396558881-29631-1-git-send-email-paul@crapouillou.net> Cc: Paul Cercueil Subject: [Buildroot] [PATCH 05/11] dialog: Patch incorrect use of toupper() X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.14 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: buildroot-bounces@busybox.net On some platforms (e.g. MIPS), the "char" type is signed by default. The problem is that toupper() takes an int as argument: a signed char then gets sign-extended to 32bit, which causes an assertion failure as toupper() verifies that its argument fits in 8 bits. Signed-Off-By: Paul Cercueil Acked-By: Maarten ter Huurne Reviewed-by: "Yann E. MORIN" Reviewed-by: Thomas De Schampheleire --- package/dialog/dialog-toupper.patch | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 package/dialog/dialog-toupper.patch diff --git a/package/dialog/dialog-toupper.patch b/package/dialog/dialog-toupper.patch new file mode 100644 index 0000000..3fe0e19 --- /dev/null +++ b/package/dialog/dialog-toupper.patch @@ -0,0 +1,13 @@ +diff --git a/dlg_keys.h b/dlg_keys.h +index 6a96c0f..b7b42d9 100644 +--- a/dlg_keys.h ++++ b/dlg_keys.h +@@ -31,7 +31,7 @@ + #define dlg_toupper(ch) towupper((wint_t)ch) + #define dlg_isupper(ch) iswupper((wint_t)ch) + #else +-#define dlg_toupper(ch) toupper(ch) ++#define dlg_toupper(ch) toupper((unsigned char)(ch)) + #define dlg_isupper(ch) (isalpha(ch) && isupper(ch)) + #endif +