* Parse the portmask provided at run time. */
| 206 | * Parse the portmask provided at run time. |
| 207 | */ |
| 208 | static int |
| 209 | parse_portmask(const char *portmask) |
| 210 | { |
| 211 | char *end = NULL; |
| 212 | |
| 213 | errno = 0; |
| 214 | |
| 215 | /* parse hexadecimal string */ |
| 216 | enabled_port_mask = strtoul(portmask, &end, 16); |
| 217 | if (portmask[0] == '\0' || end == NULL || *end != '\0' || errno != 0) { |
| 218 | fprintf(stderr, "Invalid portmask '%s'\n", portmask); |
| 219 | return -1; |
| 220 | } |
| 221 | |
| 222 | return 0; |
| 223 | } |
| 224 | |
| 225 | /* |
| 226 | * Parse ids value list into array |
no test coverage detected