Ignore:
Timestamp:
Aug 18, 2009, 3:20:42 PM (15 years ago)
Author:
Bruno Cornec
Message:

r3339@localhost: bruno | 2009-08-11 23:56:01 +0200
bkpinfo->kernel_path, bkpinfo->call_before_iso, bkpinfo->call_make_iso, bkpinfo->call_burn_iso, bkpinfo->call_after_iso and bkpinfo->postnuke_tarball are now dynamically allocated

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.2.10/mondo/src/common/libmondo-files.c

    r2327 r2328  
    274274    char *command = NULL;;
    275275
    276     if (!kernel[0]) {
    277         strcpy(kernel,
    278                call_program_and_get_last_line_of_output
    279                ("mindi --findkernel 2> /dev/null"));
     276    if (kernel == NULL) {
     277        mr_asprintf(kernel, "%s", call_program_and_get_last_line_of_output("mindi --findkernel 2> /dev/null"));
    280278    }
    281279    // If we didn't get anything back, check whether mindi raised a fatal error
     
    294292    log_it("Calling Mindi with kernel path of '%s'", kernel);
    295293    while (!kernel[0]) {
    296         if (!ask_me_yes_or_no
    297             ("Kernel not found or invalid. Choose another?")) {
     294        if (!ask_me_yes_or_no("Kernel not found or invalid. Choose another?")) {
    298295            return (1);
    299296        }
     
    302299            fatal_error("Kernel not found. Please specify with the '-k' flag.");
    303300        }
    304         strcpy(kernel, tmp);
    305         mr_free(tmp);
     301        mr_free(kernel);
     302        kernel = tmp;
    306303
    307304        log_it("User says kernel is at %s", kernel);
     
    10541051    mr_free(command);
    10551052
    1056     if (bkpinfo->postnuke_tarball[0]) {
     1053    if (bkpinfo->postnuke_tarball) {
    10571054        mr_asprintf(command, "cp -f %s %s/post-nuke.tgz", bkpinfo->postnuke_tarball, bkpinfo->tmpdir);
    10581055        res = run_program_and_log_output(command, FALSE);
Note: See TracChangeset for help on using the changeset viewer.