[PATCH] ACPI: fix test for hex digit.
From: Arjun Sreedharan
Date: Wed Jul 30 2014 - 15:52:34 EST
decimal 0 is ascii for NULL. Hex digit matching should be from '0'
(decimal 30 of ascii) to '9' and 'A' to 'F'.
Unfixed version returns true for #,$,%,& etc.
Signed-off-by: Arjun Sreedharan <arjun024@xxxxxxxxx>
---
drivers/acpi/acpi_pnp.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/acpi/acpi_pnp.c b/drivers/acpi/acpi_pnp.c
index 4ddb0dc..a4945a5 100644
--- a/drivers/acpi/acpi_pnp.c
+++ b/drivers/acpi/acpi_pnp.c
@@ -322,7 +322,7 @@ static const struct acpi_device_id acpi_pnp_device_ids[] = {
static bool is_hex_digit(char c)
{
- return (c >= 0 && c <= '9') || (c >= 'A' && c <= 'F');
+ return (c >= '0' && c <= '9') || (c >= 'A' && c <= 'F');
}
static bool matching_id(char *idstr, char *list_id)
--
1.8.1.msysgit.1
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/