Changeset 1140 in MondoRescue for branches


Ignore:
Timestamp:
Feb 12, 2007, 2:05:43 AM (17 years ago)
Author:
Bruno Cornec
Message:

Try to fix some valgrind reports (note that this version still doesn't work)

Location:
branches/stable/mondo/src
Files:
7 edited

Legend:

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

    r1137 r1140  
    10931093            ("NFS mount doesn't have a colon in it, e.g. 192.168.1.4:/home/nfs");
    10941094    }
    1095     *(p++) = '\0';
     1095    *p = '\0';
     1096    p++;
    10961097    strcpy(nfs_server_ipaddr, tmp);
    10971098    mr_free(tmp);
  • branches/stable/mondo/src/common/libmondo-fork.c

    r1139 r1140  
    235235    fin = fopen("/tmp/mondo-run-prog-thing.tmp", "r");
    236236    if (fin) {
    237         for (mr_getline(&incoming, &n, fin); !feof(fin);
    238              mr_getline(&incoming, &n, fin)) {
     237        for (mr_getline(&incoming, &n, fin); !feof(fin); mr_getline(&incoming, &n, fin)) {
    239238            /* patch by Heiko Schlittermann */
    240239            p = incoming;
  • branches/stable/mondo/src/common/libmondo-string.c

    r1116 r1140  
    771771    p = tmp;
    772772    while (*p != '\0') {
    773         in_out[i] = *(p++);
     773        in_out[i] = *p;
     774        p++;
    774775        in_out[i + 1] = '\0';
    775776        if (in_out[i] < 32 && i > 0) {
     
    797798    in_out[i] = '\0';
    798799    mr_free(tmp);
    799 /*  for(i=strlen(in_out); i>0 && in_out[i-1]<=32; i--) {in_out[i-1]='\0';} */
    800800}
    801801
  • branches/stable/mondo/src/common/libmondo-tools.c

    r1123 r1140  
    893893    /*@ buffers ************ */
    894894    char tmp[MAX_STR_LEN];
    895     //  char command[MAX_STR_LEN];
    896895
    897896    /*@ int's *************** */
     
    900899
    901900
    902     mvaddstr_and_log_it(g_currentY, 0,
    903                         "Checking sanity of your Linux distribution");
     901    mvaddstr_and_log_it(g_currentY, 0, "Checking sanity of your Linux distribution");
    904902#ifndef __FreeBSD__
    905903    if (system("which mkfs.vfat &> /dev/null")
  • branches/stable/mondo/src/mondoarchive/main.c

    r1132 r1140  
    216216    }
    217217
     218    /* BERLIOS: Hardcoded to be improved */
     219    unlink(MONDO_CACHE"/mindi.conf");
     220    unlink(MONDO_CACHE"/mondorestore.cfg");
     221
    218222    /* Configure the bkpinfo structure, global file paths, etc. */
    219223    g_main_pid = getpid();
     
    227231    welcome_to_mondoarchive();
    228232    distro_specific_kludges_at_start_of_mondoarchive();
    229     sprintf(g_erase_tmpdir_and_scratchdir, "rm -Rf %s %s", bkpinfo->tmpdir,
    230             bkpinfo->scratchdir);
    231233    g_kernel_version = get_kernel_version();
    232234
     
    327329            ("Pre-param initialization phase failed. Please review the error messages above, make the specified changes, then try again. Exiting...");
    328330    }
    329 
    330 /* Process command line, if there is one. If not, ask user for info. */
     331    sprintf(g_erase_tmpdir_and_scratchdir, "rm -Rf %s %s", bkpinfo->tmpdir,
     332            bkpinfo->scratchdir);
     333
     334    /* Process command line, if there is one. If not, ask user for info. */
    331335    if (argc == 1) {
    332336        g_text_mode = FALSE;
  • branches/stable/mondo/src/test/test-mem.c

    r1139 r1140  
    1616int main(void)
    1717{
    18     char* str = NULL;
     18    char *str = NULL;
    1919    FILE *fd = NULL;
    2020    size_t n = 0;
     
    3737    mr_getline(&str,&n,fd);
    3838    printf("2nd Result: %s",str);
     39    mr_getline(&str,&n,fd);
     40    strcpy(str,"another line\n");
     41    printf("3rd Result: %s",str);
    3942    mr_free(str);
    4043
  • branches/stable/mondo/src/test/test-string.c

    r1064 r1140  
    2020    char *string = NULL;
    2121
    22     mr_asprintf(&string, "%s", "md0 : active raid10 hda1[0] hda12[3] hda6[2] hda5[1]\n");
     22    mr_asprintf(&string, "md0 : active raid10 hda1[0] hda12[3] hda6[2] hda5[1]\n");
    2323    fprintf(stdout, "string=|%s|\n", string);
    24     token = mr_strtok(string, delims, &lastpos);
    25     while (lastpos > 0) {
     24    while ((token = mr_strtok(string, delims, &lastpos))) {
    2625        fprintf(stdout, "token=|%s|, lastpos=%d\n", token, lastpos);
    2726        mr_free(token);
    28         token = mr_strtok(string, delims, &lastpos);
    2927    }
    3028    mr_free(string);
Note: See TracChangeset for help on using the changeset viewer.