Ignore:
Timestamp:
Jun 3, 2009, 7:10:19 PM (15 years ago)
Author:
Bruno Cornec
Message:

r3089@localhost: bruno | 2009-05-18 06:41:05 +0200

  • move call to asprintf to call to mr_asprintf (suppress a compiler warning)
  • remove all the most obvious bad call to strcat and replace by mr_strcat as appropriate
File:
1 edited

Legend:

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

    r2209 r2211  
    7474    prev_part_no = 0;
    7575    tmp[0] = '\0';
    76     asprintf(&flaws_str, "%s", "");
     76    mr_asprintf(&flaws_str, "%s", "");
    7777
    7878
     
    363363    assert_string_is_neither_NULL_nor_zerolength(drive);
    364364    assert(mountlist != NULL);
    365     asprintf(&flaws_str, "%s", "");
     365    mr_asprintf(&flaws_str, "%s", "");
    366366
    367367    malloc_string(tmp);
     
    522522    assert(flaws_str_C != NULL);
    523523
    524     asprintf(&flaws_str, "%s", "");
     524    mr_asprintf(&flaws_str, "%s", "");
    525525
    526526    make_list_of_drives_in_mountlist(mountlist, drivelist);
     
    532532            (drivelist->el[i].device,
    533533             DONT_KNOW_HOW_TO_EVALUATE_THIS_DEVICE_TYPE)) {
    534             asprintf(&tmp, " Not evaluating %s (I don't know how yet)",
     534            mr_asprintf(&tmp, " Not evaluating %s (I don't know how yet)",
    535535                    drivelist->el[i].device);
    536536            log_it(tmp);
     
    606606
    607607    for (currline = 0; currline < mountlist->entries; currline++) {
    608         asprintf(&curr_mountpoint, "%s", mountlist->el[currline].mountpoint);
     608        mr_asprintf(&curr_mountpoint, "%s", mountlist->el[currline].mountpoint);
    609609        for (i = 0, copies = 0, last_copy = -1; i < mountlist->entries;
    610610             i++) {
     
    618618        if (copies > 1 && last_copy == currline
    619619            && strcmp(curr_mountpoint, "raid")) {
    620             asprintf(&tmp, " %s %s's.", number_to_text(copies),
     620            mr_asprintf(&tmp, " %s %s's.", number_to_text(copies),
    621621                    curr_mountpoint);
    622622            mr_strcat(flaws_str, "%s", tmp);
     
    657657    for (lino = 0, noof_drives = 0; lino < mountlist->entries; lino++) {
    658658
    659         asprintf(&drive, "%s", mountlist->el[lino].device);
     659        mr_asprintf(&drive, "%s", mountlist->el[lino].device);
    660660        if (!strncmp(drive, RAID_DEVICE_STUB, strlen(RAID_DEVICE_STUB))) {
    661661            log_msg(8, "Not putting %s in list of drives: it's a virtual drive", drive);
     
    733733                       (void *) &mountlist->el[i],
    734734                       sizeof(struct mountlist_line));
    735                 asprintf(&tmp,
     735                mr_asprintf(&tmp,
    736736                         "%s is available; user may choose to add it to raid device",
    737737                         output_list->el[items - 1].device);
     
    853853            if (j < items) {
    854854                strcat(mountlist->el[items].device, "_dup");
    855                 asprintf(&tmp,
     855                mr_asprintf(&tmp,
    856856                         "Duplicate entry in mountlist - renaming to %s",
    857857                         mountlist->el[items].device);
     
    859859                paranoid_free(tmp);
    860860            }
    861             asprintf(&tmp, "%s", mountlist->el[items].device);
     861            mr_asprintf(&tmp, "%s", mountlist->el[items].device);
    862862            if (strstr(tmp, "/dev/md/")) {
    863863                log_it("format_device() --- Contracting %s", tmp);
     
    10081008    assert(b >= 0);
    10091009
    1010     asprintf(&device, "%s", mountlist->el[a].device);
    1011     asprintf(&mountpoint, "%s", mountlist->el[a].mountpoint);
    1012     asprintf(&format, "%s", mountlist->el[a].format);
     1010    mr_asprintf(&device, "%s", mountlist->el[a].device);
     1011    mr_asprintf(&mountpoint, "%s", mountlist->el[a].mountpoint);
     1012    mr_asprintf(&format, "%s", mountlist->el[a].format);
    10131013
    10141014    size = mountlist->el[a].size;
Note: See TracChangeset for help on using the changeset viewer.