| 106 | */ |
| 107 | |
| 108 | static char *extractInt (char *progName, char *p, int *num) |
| 109 | { |
| 110 | if (*p != ':') |
| 111 | { |
| 112 | verbError ("%s: colon expected", progName) ; |
| 113 | return NULL ; |
| 114 | } |
| 115 | |
| 116 | ++p ; |
| 117 | |
| 118 | if (!isdigit (*p)) |
| 119 | { |
| 120 | verbError ("%s: digit expected", progName) ; |
| 121 | return NULL ; |
| 122 | } |
| 123 | |
| 124 | *num = strtol (p, NULL, 0) ; |
| 125 | |
| 126 | // Increment p, but we need to check for hex 0x |
| 127 | |
| 128 | if ((*p == '0') && (*(p + 1) == 'x')) |
| 129 | p +=2 ; |
| 130 | |
| 131 | while (isxdigit (*p)) |
| 132 | ++p ; |
| 133 | |
| 134 | return p ; |
| 135 | } |
| 136 | |
| 137 | |
| 138 | /* |
no test coverage detected