Made struct ExprtesT test -lba_range ready for long block adresses

This commit is contained in:
2024-03-20 16:05:35 +01:00
parent 435521a2c9
commit cdffa4efee
6 changed files with 54 additions and 19 deletions

View File

@ -835,7 +835,8 @@ static int Xorriso_truncate_const_find_name(struct XorrisO *xorriso,
int Xorriso_option_find(struct XorrisO *xorriso, int argc, char **argv,
int *idx, int flag)
{
int ret, i, end_idx, type= 0, action, deleter= 0, start_lba, count;
int ret, i, end_idx, type= 0, action, deleter= 0, count;
off_t start_lba, block_count;
int list_extattr_head= 0, bsl_mem, disk_path, name_space, prefix_code;
struct FindjoB *job, *first_job= NULL, *new_job;
char *start_path, *path= NULL, *cpt, *other_path_start= NULL, *cd_pt;
@ -919,9 +920,16 @@ not_enough_arguments:;
i+= 2;
/* >>> if letter suffix: use Scanf_io_size */
sscanf(argv[i-1], "%d", &start_lba);
sscanf(argv[i], "%d", &count);
Findjob_set_lba_range(job, start_lba, count, 0);
ret= Sfile_text_to_off_t(argv[i - 1], &start_lba, 0);
if(ret <= 0) {
off_t_overflow:;
sprintf(xorriso->info_text, "-find[ix]: -lba_range number too large");
goto sorry_ex;
}
ret= Sfile_text_to_off_t(argv[i], &block_count, 0);
if(ret <= 0)
goto off_t_overflow;
Findjob_set_lba_range(job, start_lba, block_count, 0);
} else if(strcmp(argv[i], "-pending_data")==0) {
Findjob_set_commit_filter_2(job, 0);
} else if(strcmp(argv[i], "-has_acl")==0) {