* Parse ids value list into array */
| 226 | * Parse ids value list into array |
| 227 | */ |
| 228 | static int |
| 229 | parse_xstats_ids(char *list, uint64_t *ids, int limit) { |
| 230 | int length; |
| 231 | char *token; |
| 232 | char *ctx = NULL; |
| 233 | char *endptr; |
| 234 | |
| 235 | length = 0; |
| 236 | token = strtok_r(list, ",", &ctx); |
| 237 | while (token != NULL) { |
| 238 | ids[length] = strtoull(token, &endptr, 10); |
| 239 | if (*endptr != '\0') |
| 240 | return -EINVAL; |
| 241 | |
| 242 | length++; |
| 243 | if (length >= limit) |
| 244 | return -E2BIG; |
| 245 | |
| 246 | token = strtok_r(NULL, ",", &ctx); |
| 247 | } |
| 248 | |
| 249 | return length; |
| 250 | } |
| 251 | |
| 252 | static int |
| 253 | parse_descriptor_param(char *list, struct desc_param *desc) |
no outgoing calls
no test coverage detected