diff mbox

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

Message ID 1291530566-23531-1-git-send-email-lacombar@gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Arnaud Lacombe Dec. 5, 2010, 6:29 a.m. UTC
None
diff mbox

Patch

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))