Made struct CheckmediajoB ready for long block adresses

This commit is contained in:
Thomas Schmitt 2024-03-18 09:44:24 +01:00
parent ba12014d46
commit 969ee9d6f5
5 changed files with 13 additions and 12 deletions

View File

@ -760,7 +760,7 @@ int Xorriso_check_media_setup_job(struct XorrisO *xorriso,
strncmp(argv[i], "min_lba=", 8) == 0) {
num= -1;
sscanf(argv[i] + 8, "%lf", &num);
if(num > 0x7fffffff || num < 0)
if(num > 0x7fffffffffffffff || num < 0)
num= -1;
if(strncmp(argv[i], "max_lba=", 8) == 0)
job->max_lba= num;
@ -777,7 +777,7 @@ int Xorriso_check_media_setup_job(struct XorrisO *xorriso,
else if(argv[i][11] >= '1' && argv[i][11] <= '9') {
num= -1;
sscanf(argv[i] + 11, "%lf", &num);
if(num > 0x7fffffff || num < 0)
if(num > 0x7fffffffffffffff || num < 0)
goto bad_value;
job->patch_lba0_msc1= num;
job->patch_lba0= (num >= 32) + (strstr(argv[i] + 11, ":force") != NULL);
@ -898,9 +898,9 @@ int Xorriso_check_media_list_job(struct XorrisO *xorriso,
sprintf(report + strlen(report), " what=%s",
job->mode == 1 ? "disc" : "tracks");
if(all || job->min_lba != dflt->min_lba)
sprintf(report + strlen(report), " min_lba=%d", job->min_lba);
sprintf(report + strlen(report), " min_lba=%.f", (double) job->min_lba);
if(all || job->max_lba != dflt->max_lba)
sprintf(report + strlen(report), " max_lba=%d", job->max_lba);
sprintf(report + strlen(report), " max_lba=%.f", (double) job->max_lba);
if(all || job->retry != dflt->retry)
sprintf(report + strlen(report), " retry=%s",
job->retry == 1 ? "on" : job->retry == -1 ? "off" : "default");
@ -932,8 +932,9 @@ int Xorriso_check_media_list_job(struct XorrisO *xorriso,
if(job->patch_lba0 == 0)
sprintf(report + strlen(report), "off");
else if(job->patch_lba0_msc1 >= 0)
sprintf(report + strlen(report), "%d%s",
job->patch_lba0_msc1, job->patch_lba0 == 2 ? ":force" : "");
sprintf(report + strlen(report), "%.f%s",
(double) job->patch_lba0_msc1,
job->patch_lba0 == 2 ? ":force" : "");
else
sprintf(report + strlen(report), "%s",
job->patch_lba0 == 2 ? "force" : "on");

View File

@ -98,8 +98,8 @@ char *Spotlist__quality_name(int quality, char name[80], int bad_limit,
struct CheckmediajoB {
int use_dev; /* 0= use indev , 1= use outdev , 2= use sector map*/
int min_lba; /* if >=0 : begin checking at this address */
int max_lba; /* if >=0 : read up to this address, else use mode */
off_t min_lba; /* if >=0 : begin checking at this address */
off_t max_lba; /* if >=0 : read up to this address, else use mode */
int min_block_size; /* granularity desired by user
*/
@ -123,7 +123,7 @@ struct CheckmediajoB {
off_t data_to_limit; /* used with file copy */
int data_to_skip; /* number of bytes to skip on writing. < 2048 */
int patch_lba0;
int patch_lba0_msc1;
off_t patch_lba0_msc1;
char sector_map_path[SfileadrL];
struct SectorbitmaP *sector_map;

View File

@ -3314,7 +3314,7 @@ int Xorriso_check_media(struct XorrisO *xorriso, struct SpotlisT **spotlist,
mode= job->mode;
if(job->min_lba > 0) {
start_lba= job->min_lba;
ret= Spotlist_add_item(*spotlist, (off_t) 0, (off_t) job->min_lba,
ret= Spotlist_add_item(*spotlist, (off_t) 0, job->min_lba,
Xorriso_read_quality_untesteD, 0);
if(ret <= 0)
goto ex;

View File

@ -1994,7 +1994,7 @@ int Xorriso_option_check_media(struct XorrisO *xorriso,
if(ret <= 0)
goto ex;
if(ret == 1) {
ret= Xorriso_update_iso_lba0(xorriso, job->patch_lba0_msc1, 0,
ret= Xorriso_update_iso_lba0(xorriso, (int) job->patch_lba0_msc1, 0,
head_buffer, job,
(8 * (job->patch_lba0 == 1)) |
4 | (job->patch_lba0_msc1 < 0));

View File

@ -1 +1 @@
#define Xorriso_timestamP "2024.03.17.205516"
#define Xorriso_timestamP "2024.03.18.084408"