From patchwork Sun Dec 5 06:29:24 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnaud Lacombe X-Patchwork-Id: 380591 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id oB56ULdY012930 for ; Sun, 5 Dec 2010 06:30:21 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752899Ab0LEGaS (ORCPT ); Sun, 5 Dec 2010 01:30:18 -0500 Received: from mail-gx0-f180.google.com ([209.85.161.180]:57318 "EHLO mail-gx0-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751481Ab0LEGaR (ORCPT ); Sun, 5 Dec 2010 01:30:17 -0500 Received: by gxk19 with SMTP id 19so5951049gxk.11 for ; Sat, 04 Dec 2010 22:30:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:cc:subject:date :message-id:x-mailer; bh=BQP+Lfuc0NhDQX54RaRS8HhlAxWbOjXjFxy2ekJL+4Q=; b=wZjtuBAxIiny5HYDIuuXh6qRP4OZGItPjKWyOUGkd7AxUxwXLCa9GeQ6vDznxJwqB0 Acg/pdavj0QN1+t9hVLEvymuOFlSrg95RUb/h9Hdp4XK75SddVZyf5e7OfeBPPvDUC1S cqaF06KX8kbiUDI+oLfSUODzd/v9SPQ6JG8YQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer; b=hAZHLIOxbVRzD72sAbd1DNaJGkVI4qKOukBdKAQm8QGAGWpaCLceoWcilkBO9EvMdh wOvgsp5IUbQsOiuSTLVb4ovjStDaL6KDzpjJBrFwU1o9UaPfCWIY8YNTfQ9Up8pGEH9z bHNiqOGl2rUrg3mp34QbQMeoRMvd05/3Lv2zA= Received: by 10.147.41.9 with SMTP id t9mr4042914yaj.20.1291530616669; Sat, 04 Dec 2010 22:30:16 -0800 (PST) Received: from localhost.localdomain (75-119-248-218.dsl.teksavvy.com [75.119.248.218]) by mx.google.com with ESMTPS id q8sm2269930yhg.1.2010.12.04.22.30.15 (version=SSLv3 cipher=RC4-MD5); Sat, 04 Dec 2010 22:30:16 -0800 (PST) From: Arnaud Lacombe To: linux-kbuild@vger.kernel.org Cc: Arnaud Lacombe Subject: [PATCH 1/5] kconfig: make hexadecimal prefix mandatory for S_HEX default value Date: Sun, 5 Dec 2010 01:29:24 -0500 Message-Id: <1291530566-23531-1-git-send-email-lacombar@gmail.com> X-Mailer: git-send-email 1.7.2.30.gc37d7.dirty Sender: linux-kbuild-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter1.kernel.org [140.211.167.41]); Sun, 05 Dec 2010 06:30:21 +0000 (UTC) diff --git a/scripts/kconfig/symbol.c b/scripts/kconfig/symbol.c index af6e9f3..ad7dbe7 100644 --- a/scripts/kconfig/symbol.c +++ b/scripts/kconfig/symbol.c @@ -548,8 +548,10 @@ bool sym_string_valid(struct symbol *sym, const char *str) } return true; case S_HEX: - if (str[0] == '0' && (str[1] == 'x' || str[1] == 'X')) - str += 2; + if (str[0] != '\0' && + !(str[0] == '0' && (str[1] == 'x' || str[1] == 'X'))) + return false; + str += 2; ch = *str++; do { if (!isxdigit(ch))