diff options
| author | B. Watson <urchlay@slackware.uk> | 2025-02-25 08:12:56 -0500 | 
|---|---|---|
| committer | B. Watson <urchlay@slackware.uk> | 2025-02-25 08:12:56 -0500 | 
| commit | 226a0828ea4ba0c68b27051c1a8eccb1354f3357 (patch) | |
| tree | 8d52e483f3def9e56d1dc2ec5ce3d0eb7ce99751 | |
| parent | d3b0717d5ca35653e2afd2c9d69fa2b94ee8a1cb (diff) | |
| download | bw-atari8-tools-226a0828ea4ba0c68b27051c1a8eccb1354f3357.tar.gz | |
listamsb: reword some warnings.
| -rw-r--r-- | listamsb.c | 21 | 
1 files changed, 17 insertions, 4 deletions
| @@ -99,7 +99,7 @@ int read_header(void) {  	}  	if(proglen < MIN_PROGLEN) { -		fprintf(stderr, "%s: not an AMSB file: program size in header too small (%d)\n", +		fprintf(stderr, "%s: not an AMSB file: program size too small (%d). Atari BASIC file?\n",  				self, proglen);  		exit(1);  	} @@ -195,6 +195,12 @@ int next_line(void) {  			unknown_token(lineno, byte, 0);  		} else {  			if(!byte) break; +			if(byte < 0x20) { +				/* ATASCII graphics outside of a string */ +				fprintf(stderr, "%s: line %d has character %d outside of a string, " +						"maybe not an AMSB file?\n", +						self, lineno, byte); +			}  			putc(byte, outfile);  		}  	} @@ -267,10 +273,14 @@ void open_output() {  			perror("/dev/null");  			exit(1);  		} +		if(verbose) +			fprintf(stderr, "using /dev/null for output (check_only)\n");  	} else if(raw_output) {  		if(isatty(fileno(stdout)))  			die("refusing to write raw ATASCII to a terminal");  		outfile = stdout; +		if(verbose) +			fprintf(stderr, "using stdout for output\n");  	} else {  		if(verbose)  			fprintf(stderr, "using pipe for output: %s\n", pipe_command); @@ -304,7 +314,7 @@ int main(int argc, char **argv) {  		if(verbose)  			fprintf(stderr, "file size matches proglen\n");  	} else { -		fprintf(stderr, "%s: file size doesn't match length in header\n", self); +		fprintf(stderr, "%s: actual program size doesn't match program size in header\n", self);  	}  	if(fgetc(infile) != EOF) { @@ -312,12 +322,15 @@ int main(int argc, char **argv) {  	}  	if(unknowns) { -		fprintf(stderr, "%s: input has %d unknown tokens\n", self, unknowns);; +		fprintf(stderr, "%s: file has %d unknown tokens\n", self, unknowns);;  		rv = 2;  	}  	if(need_pclose) { -		if(pclose(outfile) != 0) { +		int got = pclose(outfile); +		if(verbose) +			fprintf(stderr, "return value from pipe is %d\n", got); +		if(got != 0) {  			die("a8cat child process failed, do you have a8cat on your PATH?");  		}  	} | 
