Changeset 1140 in MondoRescue for branches/stable/mondo/src/test


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/test
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • 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.