Re: [PATCH 1/5] kconfig: make hexadecimal prefix mandatory for S_HEX default value

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, Dec 05, 2010 at 01:29:24AM -0500, Arnaud Lacombe wrote:
> Signed-off-by: Arnaud Lacombe <lacombar@xxxxxxxxx>
> ---
>  scripts/kconfig/symbol.c |    6 ++++--
>  1 files changed, 4 insertions(+), 2 deletions(-)
> 
> 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))

I think that saying "hex" is enough to express that the value is to be
interpreted in hexadecimal, so let's keep the 0x prefix optional.
Kconfig prints enough warnings these days... ;)

Michal
--
To unsubscribe from this list: send the line "unsubscribe linux-kbuild" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux&nblp;USB Development]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite Secrets]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux