Changeset 3610 in MondoRescue for branches/3.2/mondo/src/common/libmondo-cli.c


Ignore:
Timestamp:
Nov 5, 2016, 6:12:23 PM (7 years ago)
Author:
Bruno Cornec
Message:
  • Change interfaces for the call_program_and_get_last_line_of_output and where_is_root_mounted(now return dynamically allocated string)
  • removes useless function store_netfs_config
File:
1 edited

Legend:

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

    r3583 r3610  
    464464            mr_asprintf(tmp1, "mount | grep -E \"^[a-z]*#*%s[/]* .*\" | cut -d' ' -f3", bkpinfo->netfs_mount);
    465465        }
    466         strncpy(bkpinfo->isodir, call_program_and_get_last_line_of_output(tmp1), MAX_STR_LEN / 4);
     466        tmp2 = call_program_and_get_last_line_of_output(tmp1);
    467467        mr_free(tmp1);
     468        strncpy(bkpinfo->isodir, tmp2, MAX_STR_LEN / 4);
     469        mr_free(tmp2);
    468470
    469471        log_msg(3, "proto = %s", bkpinfo->netfs_proto);
     
    511513                    mr_asprintf(tmp1, "mount | grep -E \"^%s[/]* .*\" | cut -d' ' -f3", bkpinfo->netfs_mount);
    512514                }
    513                 strncpy(bkpinfo->isodir, call_program_and_get_last_line_of_output(tmp1), MAX_STR_LEN / 4);
     515                tmp2 = call_program_and_get_last_line_of_output(tmp1);
     516                strncpy(bkpinfo->isodir, tmp2, MAX_STR_LEN / 4);
     517                mr_free(tmp2);
    514518                if (strlen(bkpinfo->isodir) < 3) {
    515519                    retval++;
Note: See TracChangeset for help on using the changeset viewer.