| 374 | |
| 375 | |
| 376 | static int |
| 377 | crm_version_helper(const char *text, char **end_text) |
| 378 | { |
| 379 | int atoi_result = -1; |
| 380 | |
| 381 | CRM_ASSERT(end_text != NULL); |
| 382 | |
| 383 | errno = 0; |
| 384 | |
| 385 | if (text != NULL && text[0] != 0) { |
| 386 | atoi_result = (int)strtol(text, end_text, 10); |
| 387 | |
| 388 | if (errno == EINVAL) { |
| 389 | crm_err("Conversion of '%s' %c failed", text, text[0]); |
| 390 | atoi_result = -1; |
| 391 | } |
| 392 | } |
| 393 | return atoi_result; |
| 394 | } |
| 395 | |
| 396 | /* |
| 397 | * version1 < version2 : -1 |