Changeset 2375 in MondoRescue


Ignore:
Timestamp:
Sep 9, 2009, 12:00:56 PM (15 years ago)
Author:
Bruno Cornec
Message:
  • Fix a bad strncpy call
  • Fix bas mr_asprintf call (quality)
Location:
branches/2.2.10/mondo/src/common
Files:
2 edited

Legend:

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

    r2370 r2375  
    22412241
    22422242#ifdef __FreeBSD__
    2243     mr_asprintf(output, call_program_and_get_last_line_of_output("mount | grep \" on / \" | cut -d' ' -f1"));
     2243    mr_asprintf(output, "%s", call_program_and_get_last_line_of_output("mount | grep ' on / ' | cut -d' ' -f1"));
    22442244#else
    2245     mr_asprintf(output, call_program_and_get_last_line_of_output("mount | grep \" on / \" | cut -d' ' -f1 | sed s/[0-9]// | sed s/[0-9]//"));
     2245    mr_asprintf(output, "%s", call_program_and_get_last_line_of_output("mount | grep ' on / ' | cut -d' ' -f1 | sed 's/[0-9]//' | sed 's/[0-9]//'"));
    22462246    if (strstr(output, "/dev/cciss/")) {
    22472247        mr_free(output);
    2248         mr_asprintf(output, call_program_and_get_last_line_of_output("mount | grep \" on / \" | cut -d' ' -f1 | cut -dp -f1"));
     2248        mr_asprintf(output, "%s", call_program_and_get_last_line_of_output("mount | grep ' on / ' | cut -d' ' -f1 | cut -dp -f1"));
    22492249    }
    22502250    if (strstr(output, "/dev/md")) {
    22512251        mr_free(output);
    2252         mr_asprintf(output, call_program_and_get_last_line_of_output("mount | grep \" on / \" | cut -d' ' -f1"));
     2252        mr_asprintf(output, "%s", call_program_and_get_last_line_of_output("mount | grep ' on / ' | cut -d' ' -f1"));
    22532253    }
    22542254#endif
  • branches/2.2.10/mondo/src/common/libmondo-fork.c

    r2357 r2375  
    5252        for (mr_getline(tmp, fin); !feof(fin); mr_getline(tmp, fin)) {
    5353            if (strlen(tmp) > 1) {
    54                 strncpy(result, 511, tmp);
     54                strncpy(result, tmp, 511);
    5555            }
    5656            mr_free(tmp);
Note: See TracChangeset for help on using the changeset viewer.