From: zacheiss Date: Thu, 27 Jul 2000 01:08:32 +0000 (+0000) Subject: Don't dump core if we're not given a file name on the command line, X-Git-Url: http://andersk.mit.edu/gitweb/moira.git/commitdiff_plain/15e28a76f24b0e22665c16c2c0f998703854f0cb Don't dump core if we're not given a file name on the command line, don't allow users to specify more than one file, and update the usage message to remove options that no longer exist. --- diff --git a/regtape/staff.pc b/regtape/staff.pc index 41cb8176..a636b2f1 100644 --- a/regtape/staff.pc +++ b/regtape/staff.pc @@ -81,11 +81,20 @@ int main(int argc, char **argv) if (!strcmp(argv[i], "-w")) wait++; else if (file) - fprintf(stderr, "Usage: %s [-w] inputfile\n", whoami); + { + fprintf(stderr, "Usage: %s [-w] inputfile\n", whoami); + exit(1); + } else file = argv[i]; } + if (!file) + { + fprintf(stderr, "Usage: %s [-w] inputfile\n", whoami); + exit(1); + } + in = fopen(file, "r"); if (!in) { diff --git a/regtape/student.pc b/regtape/student.pc index 39469954..2a673c7e 100644 --- a/regtape/student.pc +++ b/regtape/student.pc @@ -101,12 +101,21 @@ int main(int argc, char **argv) { if (!strcmp(argv[i], "-w")) wait++; - else if (file) - fprintf(stderr, "Usage: %s [-w] [-D] [-n] inputfile\n", whoami); + if (file) + { + fprintf(stderr, "Usage: %s [-w] inputfile\n", whoami); + exit(1); + } else file = argv[i]; } + if (!file) + { + fprintf(stderr, "Usage: %s [-w] inputfile\n", whoami); + exit(1); + } + in = fopen(file, "r"); if (!in) {