Changeset 1140 in MondoRescue for branches/stable/mondo/src/test/test-string.c


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

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

File:
1 edited

Legend:

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