projects
/
fio.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
a59e170
)
Parser: make check_int() accept hex input if prefixed with 0x
author
Jens Axboe
<jens.axboe@oracle.com>
Mon, 30 Jul 2007 07:07:04 +0000
(09:07 +0200)
committer
Jens Axboe
<jens.axboe@oracle.com>
Mon, 30 Jul 2007 07:07:04 +0000
(09:07 +0200)
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
parse.c
patch
|
blob
|
blame
|
history
diff --git
a/parse.c
b/parse.c
index f0e644f113bf63171fbebc8e0bd2545ae5d0fcd8..6fd617ce57468883b777d8d2e346076383690f92 100644
(file)
--- a/
parse.c
+++ b/
parse.c
@@
-188,8
+188,13
@@
static int check_int(const char *p, int *val)
{
if (!strlen(p))
return 1;
- if (sscanf(p, "%u", val) == 1)
- return 0;
+ if (strstr(p, "0x")) {
+ if (sscanf(p, "%x", val) == 1)
+ return 0;
+ } else {
+ if (sscanf(p, "%u", val) == 1)
+ return 0;
+ }
return 1;
}