diff options
| author | B. Watson <urchlay@slackware.uk> | 2024-04-30 04:09:14 -0400 | 
|---|---|---|
| committer | B. Watson <urchlay@slackware.uk> | 2024-04-30 04:09:14 -0400 | 
| commit | f952610919261d2d83ad69d11b071a3b64f7af6c (patch) | |
| tree | f35604e2c49a0855950d73483098ec040854cf03 | |
| parent | 3c4599d7202d685ab24935d1348ad9ab167fce02 (diff) | |
| download | bw-atari8-tools-f952610919261d2d83ad69d11b071a3b64f7af6c.tar.gz | |
xexamine: report errors.
| -rw-r--r-- | xex.c | 2 | ||||
| -rw-r--r-- | xexamine.c | 10 | 
2 files changed, 6 insertions, 6 deletions
| @@ -173,7 +173,7 @@ int xex_fread_seg_data(xex_segment *seg, FILE *file) {  		return 1;  	} -	if(ferror(file)) { +	if(res < 0 || ferror(file)) {  		xex_errno = XERR_SYSCALL;  	} else {  		/* EOF or short read */ @@ -358,11 +358,6 @@ int main(int argc, char **argv) {  		while(xex_fread_seg(&seg, f)) {  			segcount++; -			xex_check_seg(&seg); -			if(xex_errno) { -				xex_perror(filename); -			} -  			crc = 0;  			crc32(seg.object, seg.len, &crc); @@ -391,6 +386,11 @@ int main(int argc, char **argv) {  			offset = ftell(f);  		} +		if(xex_errno) { +			fprintf(stderr, SELF ": %s: %s\n", +					filename, xex_strerror(xex_errno)); +		} +  		if(only_segment && (segcount < only_segment)) {  			fprintf(stderr, SELF ": can't show segment %d, only %d segments in file.\n", only_segment, segcount);  			return 1; | 
