Changeset 1140 in MondoRescue for branches/stable/mondo/src/test
- Timestamp:
- Feb 12, 2007, 2:05:43 AM (18 years ago)
- Location:
- branches/stable/mondo/src/test
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/stable/mondo/src/test/test-mem.c
r1139 r1140 16 16 int main(void) 17 17 { 18 char *str = NULL;18 char *str = NULL; 19 19 FILE *fd = NULL; 20 20 size_t n = 0; … … 37 37 mr_getline(&str,&n,fd); 38 38 printf("2nd Result: %s",str); 39 mr_getline(&str,&n,fd); 40 strcpy(str,"another line\n"); 41 printf("3rd Result: %s",str); 39 42 mr_free(str); 40 43 -
branches/stable/mondo/src/test/test-string.c
r1064 r1140 20 20 char *string = NULL; 21 21 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"); 23 23 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))) { 26 25 fprintf(stdout, "token=|%s|, lastpos=%d\n", token, lastpos); 27 26 mr_free(token); 28 token = mr_strtok(string, delims, &lastpos);29 27 } 30 28 mr_free(string);
Note:
See TracChangeset
for help on using the changeset viewer.