Changeset 2398 in MondoRescue for branches/2.2.9/mondo/src


Ignore:
Timestamp:
Sep 15, 2009, 4:00:13 PM (15 years ago)
Author:
Bruno Cornec
Message:
  • Fix a bug where flaws_str could be NULL and wasn't tested correctly.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.2.9/mondo/src/mondorestore/mondo-rstr-newt.c

    r2394 r2398  
    19751975    while (!finished) {
    19761976        flaws_str = evaluate_mountlist(mountlist);
    1977         if (strlen(flaws_str) > 0) {
     1977        /* flaws_str can be NULL */
     1978        if ((flaws_str == NULL) || (strlen(flaws_str) == 0)) {
     1979            mr_asprintf(&flaws_str_A, "");
     1980        } else {
    19781981            mr_asprintf(&flaws_str_A, "%s", flaws_str + 1);
    1979         } else {
    1980             mr_asprintf(&flaws_str_A, "");
    19811982        }
    19821983        if (strlen(flaws_str_A) >= 74) {
     
    19941995            mr_asprintf(&flaws_str_C, "");
    19951996        }
    1996         mr_free(flaws_str);
    19971997
    19981998        newtLabelSetText(flawsLabelA, flaws_str_A);
     
    20052005
    20062006        if (b_res == bOK) {
    2007             flaws_str = evaluate_mountlist(mountlist);
    20082007            if (flaws_str != NULL) {
    2009                 mr_free(flaws_str);
    20102008                finished =
    20112009                    ask_me_yes_or_no
     
    20602058            }
    20612059        }
     2060        mr_free(flaws_str);
    20622061    }
    20632062    newtFormDestroy(myForm);
Note: See TracChangeset for help on using the changeset viewer.