Ignore:
Timestamp:
Apr 22, 2014, 11:06:38 AM (10 years ago)
Author:
Bruno Cornec
Message:
  • Fix a bug due to lack of memory allocation for a tmp var to display
  • Fix another bug in the call to labeling which used a bad variable
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/3.2/mondo/src/common/libmondo-mountlist.c

    r3237 r3263  
    413413    }
    414414
     415    /* GPT allows more than 4 primary partitions - detect partition type now */
     416    part_table_fmt = which_partition_format(drive);
     417
    415418    for (curr_part_no = 1; curr_part_no < 99; curr_part_no++) {
    416419        build_partition_name(device, drive, curr_part_no);
     
    428431                mr_free(tmp);
    429432                res++;
    430             } else if (curr_part_no > 5
    431                        || (curr_part_no <= 4 && prev_part_no > 0)) {
     433            } else if (curr_part_no > 5 || (curr_part_no <= 4 && prev_part_no > 0)) {
    432434                mr_asprintf(tmp, " Gap on %s between %d and %d.", drive, prev_part_no, curr_part_no);
    433435                log_it(tmp);
     
    437439            }
    438440        }
    439         /* GPT allows more than 4 primary partitions */
    440         part_table_fmt = which_partition_format(drive);
    441441        /* no spare primary partitions to help accommodate the logical(s)? */
    442442        if ((curr_part_no >= 5 && prev_part_no == 4) && (strcmp(part_table_fmt, "MBR") == 0)) {
     
    447447            res++;
    448448        }
    449         mr_free(part_table_fmt);
    450449
    451450        /* does partition /dev/hdNX exist more than once in the mountlist? */
     
    498497        prev_part_no = curr_part_no;
    499498    }
     499    mr_free(part_table_fmt);
    500500
    501501    /* Over-allocated the disk? Unallocated space on disk? */
     
    589589            }
    590590        }
    591         if (copies > 1 && last_copy == currline
    592             && strcmp(curr_mountpoint, "raid")) {
     591        if (copies > 1 && last_copy == currline && strcmp(curr_mountpoint, "raid")) {
    593592            mr_asprintf(tmp, " %s %s's.", number_to_text(copies), curr_mountpoint);
    594593            mr_strcat(flaws_str, "%s", tmp);
Note: See TracChangeset for help on using the changeset viewer.