Ignore:
Timestamp:
Nov 18, 2016, 5:31:43 PM (7 years ago)
Author:
Bruno Cornec
Message:

mr_strip_spaces now returns a dynamically allocated string

File:
1 edited

Legend:

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

    r3611 r3614  
    198198        b_res = newtRunForm(myForm);
    199199        mr_free(device_str);
    200         mr_asprintf(device_str, "%s", device_here);
     200        device_str = mr_strip_spaces(device_here);
    201201
    202202        mr_free(mountpoint_str);
    203         mr_asprintf(mountpoint_str, "%s", mountpoint_here);
    204         mr_strip_spaces(mountpoint_str);
     203        mountpoint_str = mr_strip_spaces(mountpoint_here);
    205204
    206205        mr_free(format_str);
    207         mr_asprintf(format_str, "%s", format_here);
    208         mr_strip_spaces(format_str);
     206        format_str = mr_strip_spaces(format_here);
    209207
    210208        mr_free(size_str);
    211         mr_asprintf(size_str, "%s", size_here);
    212         mr_strip_spaces(size_str);
    213 
    214         mr_strip_spaces(device_str);
     209        size_str = mr_strip_spaces(size_here);
     210
    215211        if (b_res == bOK) {
    216212            if (device_str[strlen(device_str) - 1] == '/') {
     
    12081204        b_res = newtRunForm(myForm);
    12091205        mr_free(device_str);
    1210         mr_asprintf(device_str, "%s", device_here);
    1211         mr_strip_spaces(device_str);
     1206        device_str = mr_strip_spaces(device_here);
    12121207
    12131208        mr_free(mountpoint_str);
    1214         mr_asprintf(mountpoint_str, "%s", mountpoint_here);
    1215         mr_strip_spaces(mountpoint_str);
     1209        mountpoint_str = mr_strip_spaces(mountpoint_here);
    12161210
    12171211        mr_free(format_str);
    1218         mr_asprintf(format_str, "%s", format_here);
    1219         mr_strip_spaces(format_str);
     1212        format_str = mr_strip_spaces(format_here);
    12201213
    12211214        if (b_res == bOK && strstr(device_str, RAID_DEVICE_STUB)
     
    12341227            && strcmp(mountlist->el[currline].mountpoint, "image")) {
    12351228            mr_free(size_str);
    1236             mr_asprintf(size_str, "%s", size_here);
    1237             mr_strip_spaces(size_str);
     1229            size_str = mr_strip_spaces(size_here);
    12381230        } else {
    12391231            mr_asprintf(size_str, "%ld", calculate_raid_device_size(mountlist, raidlist, mountlist->el[currline].device) / 1024);
Note: See TracChangeset for help on using the changeset viewer.