Changeset 3859 in MondoRescue for branches/3.3/mondo/src/mondorestore/mondo-rstr-mountlist.c
- Timestamp:
- Mar 7, 2024, 1:33:54 AM (4 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/3.3/mondo/src/mondorestore/mondo-rstr-mountlist.c
r3611 r3859 54 54 55 55 /*@ buffers ******************************************************** */ 56 char tmp = NULL;57 char tmp1 = NULL;58 char device[MAX_STR_LEN];56 char *tmp = NULL; 57 char *tmp1 = NULL; 58 char *device = NULL; 59 59 60 60 char *flaws_str = NULL; … … 86 86 /* check DD */ 87 87 for (cur_sp_no = 'a'; cur_sp_no < 'z'; ++cur_sp_no) { 88 sprintf(device, "%s%c", drive, cur_sp_no);88 mr_asprintf(device, "%s%c", drive, cur_sp_no); 89 89 if (find_device_in_mountlist(mountlist, device) >= 0) 90 90 foundsome = TRUE; … … 92 92 if (foundsome) { 93 93 for (cur_sp_no = 'a'; cur_sp_no < 'z'; ++cur_sp_no) { 94 sprintf(device, "%s%c", drive, cur_sp_no);94 mr_asprintf(device, "%s%c", drive, cur_sp_no); 95 95 pos = find_device_in_mountlist(mountlist, device); 96 96 if (pos < 0) { … … 160 160 npos = pos = 0; 161 161 for (curr_part_no = 1; curr_part_no < 99; curr_part_no++) { 162 build_partition_name(device,drive, curr_part_no);162 device = build_partition_name(drive, curr_part_no); 163 163 pos = find_device_in_mountlist(mountlist, device); 164 164 npos = 0; 165 165 for (cur_sp_no = 'a'; cur_sp_no <= 'h'; cur_sp_no++) { 166 sprintf(device, "%ss%i%c", device, curr_part_no, cur_sp_no);166 mr_asprintf(device, "%ss%i%c", device, curr_part_no, cur_sp_no); 167 167 if (find_device_in_mountlist(mountlist, device) >= 0) 168 168 npos++; … … 170 170 if (((pos >= 0) || npos) && foundsome) { 171 171 mr_strcat(flaws_str, " %s has both DD and PC-style partitions.", drive); 172 mr_free(device); 172 173 return(flaws_str); // fatal error 173 174 } 174 175 175 build_partition_name(device, drive, curr_part_no);176 176 if (pos > 0 && !npos) { 177 177 /* gap in the partition list? */ … … 255 255 /* Check subpartitions */ 256 256 for (cur_sp_no = 'a'; cur_sp_no < 'z'; ++cur_sp_no) { 257 sprintf(device, "%ss%d%c", drive, curr_part_no, cur_sp_no);257 mr_asprintf(device, "%ss%d%c", drive, curr_part_no, cur_sp_no); 258 258 pos = find_device_in_mountlist(mountlist, device); 259 259 if (pos < 0) { … … 344 344 } 345 345 prev_part_no = curr_part_no; 346 mr_free(device); 346 347 } 347 348 … … 397 398 mr_asprintf(flaws_str, "%s", ""); 398 399 399 malloc_string(device);400 400 prev_part_no = 0; 401 401 … … 421 421 422 422 for (curr_part_no = 1; curr_part_no < 99; curr_part_no++) { 423 build_partition_name(device,drive, curr_part_no);423 device = build_partition_name(drive, curr_part_no); 424 424 pos = find_device_in_mountlist(mountlist, device); 425 425 if (pos < 0) { … … 520 520 521 521 endoffunc: 522 paranoid_free(device);522 mr_free(device); 523 523 524 524 if (res == 0) {
Note:
See TracChangeset
for help on using the changeset viewer.