X-Git-Url: https://jxself.org/git/?p=super-star-trek.git;a=blobdiff_plain;f=sst.c;h=e4fe2afe0fcf55a0eab1f3f5d3a4001e47c6bd79;hp=2c888443c27eeaf4c6b943d71442fee786e68ecb;hb=f14a35629e403d9b2cd4e406e80666671fd2a594;hpb=b0629033955fcfdcd93a4a2cf3ab29e8adc56200 diff --git a/sst.c b/sst.c index 2c88844..e4fe2af 100644 --- a/sst.c +++ b/sst.c @@ -13,8 +13,6 @@ static int linecount; /* for paging */ static void clearscreen(void); -#define NUMCOMMANDS 34 - /* Compared to original version, I've changed the "help" command to "call" and the "terminate" command to "quit" to better match user expectations. The DECUS version apparently made those changes @@ -52,7 +50,7 @@ static void clearscreen(void); */ -static char *commands[NUMCOMMANDS] = { +static char *commands[] = { "srscan", "lrscan", "phasers", @@ -88,6 +86,7 @@ static char *commands[NUMCOMMANDS] = { "quit", "help" }; +#define NUMCOMMANDS sizeof(commands)/sizeof(commands[0]) static void listCommands(int x) { prout(" SRSCAN MOVE PHASERS CALL\n" @@ -210,7 +209,7 @@ static void makemoves(void) { warp(1); break; case 5: // shields - sheild(1); + doshield(1); if (ididit) { attack(2); shldchg = 0; @@ -345,7 +344,7 @@ static void makemoves(void) { } -void main(int argc, char **argv) { +int main(int argc, char **argv) { int i; int hitme; char ch; @@ -401,8 +400,8 @@ void cramen(int i) { case IHP: s = "Planet"; break; case IHB: s = "Starbase"; break; case IHBLANK: s = "Black hole"; break; - case IHT: s = "Tholean"; break; - case IHWEB: s = "Tholean web"; break; + case IHT: s = "Tholian"; break; + case IHWEB: s = "Tholian web"; break; default: s = "Unknown??"; break; } proutn(s); @@ -486,7 +485,8 @@ int scan(void) { chew(); return IHEOL; } - gets(line); + fgets(line, sizeof(line), stdin); + line[strlen(line)-1] = '\0'; linep = line; } // Skip leading white space