diff options
| -rw-r--r-- | taipan.c | 27 | 
1 files changed, 15 insertions, 12 deletions
| @@ -321,6 +321,9 @@ extern char *ultostr(unsigned long value, char* s);  #define DEBT_MAX 1952257860L  char wu_assassin; +/* maximum length of the user's firm name. was 22, no reason not to allow 24. */ +#define MAX_FIRM 24 +  /* taipan functions (modified as little as possible) */  #define GENERIC 1  #define LI_YUEN 2 @@ -391,7 +394,7 @@ extern void clear_hkw(void);  /* use page 6 for these buffers, for .xex build. Otherwise they're BSS. */  #ifdef CART_TARGET -char firm[23]; +char firm[MAX_FIRM + 1];  char num_buf[20];  #else  char *firm = (char *) 0x680; @@ -1732,14 +1735,14 @@ void port_stats(void) {  		chline(40);  		gotox0y(0); -		cspaces(firmpos); +		clrtoeol(); +		if(firmpos) cspaces(firmpos);  		// cputs("Firm: ");  		cprint_firm_colon();  		cputs(firm);  		comma_space();  		// cputs(location[1]);  		print_location(1); -		clrtoeol();  	}  	/* dynamic stuff: */ @@ -3059,9 +3062,9 @@ void name_firm(void) {  	cputc(5);  	print_bar_line();  	cprint_pipe(); -	cspaces(5); +	cspaces(4);  	cprint_taipan_comma(); -	cspaces(25); +	cspaces(26);  	cprint_pipe();  	print_bar_line();  	cprint_pipe(); @@ -3071,21 +3074,21 @@ void name_firm(void) {  	cprint_pipe();  	print_bar_line();  	cprint_pipe(); -	cspaces(5); +	cspaces(4);  	cprint_firm_colon(); -	cspaces(28); +	cspaces(29);  	cprint_pipe();  	cprint_pipe(); -	cspaces(11); -	chline(22); -	cspaces(5); +	cspaces(10); +	chline(MAX_FIRM); +	cspaces(4);  	cprint_pipe();  	print_bar_line();  	cputc(26);  	chline(38);  	cputc(3); -	gotoxy(12, 13); +	gotoxy(11, 13);     while(1) {  		if((input = agetc()) == ENTER) { @@ -3102,7 +3105,7 @@ void name_firm(void) {  				backspace();  				--firmlen;  			} -		} else if(firmlen < 22) { +		} else if(firmlen < MAX_FIRM) {  			cputc(firm[firmlen++] = input | 0x80);  			randseed <<= 1;  			randseed += (input - 32); | 
