summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tools.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/tools.c b/tools.c
index 4609619..21f7736 100644
--- a/tools.c
+++ b/tools.c
@@ -17,8 +17,12 @@ int pcilib_isnumber(const char *str) {
int pcilib_isxnumber(const char *str) {
int i = 0;
- for (i = 0; str[i]; i++)
+
+ if ((str[0] == '0')&&((str[1] == 'x')||(str[1] == 'X'))) i += 2;
+
+ for (; str[i]; i++)
if (!isxdigit(str[i])) return 0;
+
return 1;
}