20 |
|
|
21 |
#include "dump.h" |
#include "dump.h" |
22 |
|
|
|
#define isdecdigit(c) isdigit(c) |
|
|
#define ishexdigit(c) (isxdigit)(c) |
|
|
|
|
23 |
static void |
static void |
24 |
odoffset(dumper_t *dumper, int argc, char ***argvp) |
odoffset(dumper_t *dumper, int argc, char ***argvp) |
25 |
{ |
{ |
48 |
|
|
49 |
if ((*p != '+') |
if ((*p != '+') |
50 |
&& (argc < 2 |
&& (argc < 2 |
51 |
|| (!isdecdigit(p[0]) |
|| (!isdigit(p[0]) |
52 |
&& ((p[0] != 'x') || !ishexdigit(p[1]))))) |
&& ((p[0] != 'x') || !isxdigit(p[1]))))) |
53 |
return; |
return; |
54 |
|
|
55 |
base = 0; |
base = 0; |
59 |
*/ |
*/ |
60 |
if (p[0] == '+') |
if (p[0] == '+') |
61 |
++p; |
++p; |
62 |
if (p[0] == 'x' && ishexdigit(p[1])) { |
if (p[0] == 'x' && isxdigit(p[1])) { |
63 |
++p; |
++p; |
64 |
base = 16; |
base = 16; |
65 |
} else if (p[0] == '0' && p[1] == 'x') { |
} else if (p[0] == '0' && p[1] == 'x') { |
69 |
|
|
70 |
/* skip over the number */ |
/* skip over the number */ |
71 |
if (base == 16) |
if (base == 16) |
72 |
for (num = p; ishexdigit(*p); ++p) |
for (num = p; isxdigit(*p); ++p) |
73 |
continue; |
continue; |
74 |
else |
else |
75 |
for (num = p; isdecdigit(*p); ++p) |
for (num = p; isdigit(*p); ++p) |
76 |
continue; |
continue; |
77 |
|
|
78 |
/* check for no number */ |
/* check for no number */ |