X-Git-Url: https://diplodocus.org/git/nmh/blobdiff_plain/c6f2d14d9c38345075629af3487c2de491584ca1..f66fd42c75d104cdde28cc23de02bf4ddaf95d15:/sbr/read_switch.c?ds=sidebyside diff --git a/sbr/read_switch.c b/sbr/read_switch.c index dcc14b78..c700243b 100644 --- a/sbr/read_switch.c +++ b/sbr/read_switch.c @@ -19,20 +19,20 @@ read_switch (const char *prompt, const struct swit *ansp) char ansbuf[BUFSIZ]; for (;;) { - printf ("%s", prompt); + fputs(prompt, stdout); fflush (stdout); cp = ansbuf; while ((i = getchar ()) != '\n') { if (i == EOF) return 0; if (cp < &ansbuf[sizeof ansbuf - 1]) { - i = (isalpha(i) && isupper(i)) ? tolower(i) : i; + i = tolower(i); *cp++ = i; } } *cp = '\0'; if (ansbuf[0] == '?' || cp == ansbuf) { - printf ("Options are:\n"); + puts("Options are:"); for (ap = ansp; ap->sw; ap++) printf (" %s\n", ap->sw); continue;