| 536 | } |
| 537 | |
| 538 | int |
| 539 | crm_parse_int(const char *text, const char *default_text) |
| 540 | { |
| 541 | int atoi_result = -1; |
| 542 | |
| 543 | if (text != NULL) { |
| 544 | atoi_result = crm_int_helper(text, NULL); |
| 545 | if (errno == 0) { |
| 546 | return atoi_result; |
| 547 | } |
| 548 | } |
| 549 | |
| 550 | if (default_text != NULL) { |
| 551 | atoi_result = crm_int_helper(default_text, NULL); |
| 552 | if (errno == 0) { |
| 553 | return atoi_result; |
| 554 | } |
| 555 | |
| 556 | } else { |
| 557 | crm_err("No default conversion value supplied"); |
| 558 | } |
| 559 | |
| 560 | return -1; |
| 561 | } |
| 562 | |
| 563 | gboolean |
| 564 | safe_str_neq(const char *a, const char *b) |