Changeset 3060 in MondoRescue for branches/3.0/mondo/src/common/libmondo-mountlist.c
- Timestamp:
- Nov 10, 2012, 5:05:37 AM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/3.0/mondo/src/common/libmondo-mountlist.c
r2944 r3060 50 50 int pos = 0, npos = 0; 51 51 int res = 0; 52 int mountpoint_copies = 0;53 52 int device_copies = 0; 54 53 int i = 0; … … 111 110 } 112 111 /* does partition /dev/adXsYZ exist more than once in the mountlist? */ 113 for (i = 0, mountpoint_copies = 0,device_copies = 0;112 for (i = 0, device_copies = 0; 114 113 i < mountlist->entries; i++) { 115 114 if (!strcmp(device, mountlist->el[i].device)) { … … 208 207 } 209 208 /* does partition /dev/adXsY exist more than once in the mountlist? */ 210 for (i = 0, mountpoint_copies = 0,device_copies = 0;209 for (i = 0, device_copies = 0; 211 210 i < mountlist->entries; i++) { 212 211 if (!strcmp(device, mountlist->el[i].device)) { … … 271 270 } 272 271 /* does partition /dev/adXsYZ exist more than once in the mountlist? */ 273 for (i = 0, mountpoint_copies = 0,device_copies = 0;272 for (i = 0, device_copies = 0; 274 273 i < mountlist->entries; i++) { 275 274 if (!strcmp(device, mountlist->el[i].device)) { … … 372 371 int pos = 0; 373 372 int res = 0; 374 int mountpoint_copies = 0;375 373 int device_copies = 0; 376 374 int i = 0; … … 454 452 } 455 453 /* does partition /dev/hdNX exist more than once in the mountlist? */ 456 for (i = 0, mountpoint_copies = 0,device_copies = 0;454 for (i = 0, device_copies = 0; 457 455 i < mountlist->entries; i++) { 458 456 if (!strcmp(device, mountlist->el[i].device)) { … … 812 810 char *tmp = NULL; 813 811 char *p = NULL; 812 char *q = NULL; 814 813 815 814 int items = 0; … … 827 826 malloc_string(incoming); 828 827 malloc_string(siz); 829 (void)fgets(incoming, MAX_STR_LEN - 1, fin);828 q = fgets(incoming, MAX_STR_LEN - 1, fin); 830 829 log_it("Loading mountlist..."); 831 while (!feof(fin) ) {830 while (!feof(fin) && (q != NULL)) { 832 831 #if linux 833 832 res = sscanf(incoming, … … 863 862 "Ignoring %s in mountlist - not loading that line :) ", 864 863 mountlist->el[items].device); 865 (void)fgets(incoming, MAX_STR_LEN - 1, fin);864 q = fgets(incoming, MAX_STR_LEN - 1, fin); 866 865 continue; 867 866 } … … 906 905 } 907 906 } 908 (void)fgets(incoming, MAX_STR_LEN - 1, fin);907 q = fgets(incoming, MAX_STR_LEN - 1, fin); 909 908 } 910 909 paranoid_fclose(fin);
Note:
See TracChangeset
for help on using the changeset viewer.