Changeset 2350 in MondoRescue for branches/2.2.9/mondo/src/common/libmondo-string.c
- Timestamp:
- Aug 28, 2009, 2:24:19 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.2.9/mondo/src/common/libmondo-string.c
r2242 r2350 608 608 * @param flaws_str_B Where to put the second 74-or-less characters. 609 609 * @param flaws_str_C Where to put the rest. 610 * @param res The result of the original evaluate_mountlist() operation. 611 * @return TRUE if res == 0, FALSE otherwise. 612 */ 613 bool 610 */ 611 void 614 612 spread_flaws_across_three_lines(char *flaws_str, char *flaws_str_A, 615 char *flaws_str_B, char *flaws_str_C, 616 int res) 613 char *flaws_str_B, char *flaws_str_C) 617 614 { 618 615 … … 621 618 622 619 /*@ initialize ****************************************************** */ 623 assert(flaws_str_A != NULL);624 assert(flaws_str_B != NULL);625 assert(flaws_str_C != NULL);626 620 assert(flaws_str != NULL); 627 621 628 if (!res && !strlen(flaws_str)) {629 return (TRUE);630 }631 622 if (strlen(flaws_str) > 0) { 632 paranoid_free(flaws_str_A);633 623 mr_asprintf(&flaws_str_A, "%s", flaws_str + 1); 634 624 } 635 625 if (strlen(flaws_str_A) >= 74) { 636 626 for (i = 74; flaws_str_A[i] != ' '; i--); 637 paranoid_free(flaws_str_B);638 627 mr_asprintf(&flaws_str_B, "%s", flaws_str_A + i + 1); 639 628 flaws_str_A[i] = '\0'; … … 641 630 if (strlen(flaws_str_B) >= 74) { 642 631 for (i = 74; flaws_str_B[i] != ' '; i--); 643 paranoid_free(flaws_str_C);644 632 mr_asprintf(&flaws_str_C, "%s", flaws_str_B + i + 1); 645 633 flaws_str_B[i] = '\0'; 646 }647 if (res) {648 return (FALSE);649 } else {650 return (TRUE);651 634 } 652 635 }
Note:
See TracChangeset
for help on using the changeset viewer.