From ac08c751b0bdb7b13c7d0e36e34aec3ec73ae734 Mon Sep 17 00:00:00 2001 From: "B. Watson" Date: Fri, 31 May 2024 14:31:00 -0400 Subject: unprotbas: capitalize stderr messages. --- unprotbas.c | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) (limited to 'unprotbas.c') diff --git a/unprotbas.c b/unprotbas.c index a179a0c..2f6fa38 100644 --- a/unprotbas.c +++ b/unprotbas.c @@ -111,7 +111,7 @@ void die(const char *msg) { /* read entire file into memory */ int readfile(void) { int got = fread(data, 1, BUFSIZE - 1, input_file); - if(verbose) fprintf(stderr, "read %d bytes\n", got); + if(verbose) fprintf(stderr, "Read %d bytes\n", got); fclose(input_file); if(got < MIN_PROG_SIZE) die("File too short to be a BASIC program (truncated?)\n"); @@ -240,7 +240,7 @@ int fixcode(void) { if(data[i] != data[pos]) same = 0; } if(verbose) { - fprintf(stderr, "trailing garbage at EOF, %d bytes, ", filelen - pos); + fprintf(stderr, "Trailing garbage at EOF, %d bytes, ", filelen - pos); if(same) fprintf(stderr, "all $%02x", data[pos]); else @@ -461,7 +461,7 @@ void adjust_vntable_size(int oldsize, int newsize) { int move_by; if(oldsize != newsize) { move_by = newsize - oldsize; - if(verbose) fprintf(stderr, "need %d bytes for vntable, have %d, moving VVTP by %d to $%04x\n", + if(verbose) fprintf(stderr, "Need %d bytes for vntable, have %d, moving VVTP by %d to $%04x\n", newsize, oldsize, move_by, vvtp + move_by); move_code(move_by); } @@ -521,10 +521,10 @@ void check_varname(const unsigned char *name, int line) { /* fprintf(stderr, "check_varname(\"%s\", %d)\n", name, line); */ - if(len < 1) die_mapfile("blank variable name", line); - if(len > 128) die_mapfile("variable name >128 characters", line); + if(len < 1) die_mapfile("Blank variable name", line); + if(len > 128) die_mapfile("Variable name >128 characters", line); if(name[0] < 'A' || name[0] > 'Z') - die_mapfile("invalid variable name (first character must be a letter)", line); + die_mapfile("Invalid variable name (first character must be a letter)", line); for(i = 1; i < len; i++) { c = name[i]; @@ -534,9 +534,9 @@ void check_varname(const unsigned char *name, int line) { if(i == (len - 1)) continue; else - die_mapfile("invalid variable name: $ and ( only allowed at end", line); + die_mapfile("Invalid variable name: $ and ( only allowed at end", line); } - die_mapfile("invalid character in variable name", line); + die_mapfile("Invalid character in variable name", line); } if(c == 0) c = name[0]; @@ -619,7 +619,7 @@ void apply_var_map(void) { unsigned char *v; if(verbose) - fprintf(stderr, "using variable names from " MAP_FILE "\n"); + fprintf(stderr, "Using variable names from " MAP_FILE "\n"); for(i = 0; i < varmap_count; i++) { v = varmap[i]; @@ -642,12 +642,12 @@ void scramble_vars(void) { int i; if(!vntable_ok()) { - fprintf(stderr, "%s: program already was variable-protected.\n", self); + fprintf(stderr, "%s: Program already was variable-protected.\n", self); exit(2); } if(shrinktable) { - if(verbose) fprintf(stderr, "shrinking variable name table\n"); + if(verbose) fprintf(stderr, "Shrinking variable name table\n"); adjust_vntable_size((vvstart - 1) - vnstart, (codestart - vvstart) / 8); } @@ -662,13 +662,13 @@ void scramble_vars(void) { if(verbose) { i -= vnstart; if(i) { - fprintf(stderr, "replaced %d byte variable name table with ", i); + fprintf(stderr, "Replaced %d byte variable name table with ", i); if(varname_char == -1) fprintf(stderr, "random characters.\n"); else fprintf(stderr, "character $%02x\n", varname_char); } else { - die("can't protect variables because there are no variables."); + die("Can't protect variables because there are no variables."); } } } @@ -824,8 +824,8 @@ void parse_args(int argc, char **argv) { } } - if(!input_file) die("no input file given (use - for stdin)"); - if(!checkonly && !output_filename) die("no output file given (use - for stdout)"); + if(!input_file) die("No input file given (use - for stdin)"); + if(!checkonly && !output_filename) die("No output file given (use - for stdout)"); if(keepvars && forcevars) die("-f and -n are mutually exclusive"); if(readmap && writemap) die("-r and -w are mutually exclusive"); if(readmap && keepvars) die("-r and -n are mutually exclusive (maybe you want -w?)"); @@ -850,7 +850,7 @@ int main(int argc, char **argv) { if(protect_code || protect_vars) { if(verbose) { - fprintf(stderr, "%s: protecting program, ", self); + fprintf(stderr, "Protecting program, "); if(protect_vars && !protect_code) fprintf(stderr, "variables only.\n"); else if(protect_code && !protect_vars) @@ -899,7 +899,7 @@ int main(int argc, char **argv) { open_output(output_filename); outbytes = fwrite(data, 1, filelen, output_file); fclose(output_file); - if(verbose) fprintf(stderr, "wrote %d bytes\n", outbytes); + if(verbose) fprintf(stderr, "Wrote %d bytes\n", outbytes); if(writemap) write_var_map(); -- cgit v1.2.3