summaryrefslogtreecommitdiffstats
path: root/4/11.c
diff options
context:
space:
mode:
authorSadeep Madurange <smadurange@users.noreply.github.com>2021-12-21 18:20:53 +0800
committerSadeep Madurange <smadurange@users.noreply.github.com>2021-12-21 18:20:53 +0800
commit81b3b08c46f906e1969334975636f8cdb4dad464 (patch)
treee523b84aea1385ea704e0254e5b2bb806e868838 /4/11.c
parent92701707e22651a74442b43387f07abf565844cd (diff)
downloadk&r-exercises-81b3b08c46f906e1969334975636f8cdb4dad464.tar.gz
4.11
Diffstat (limited to '4/11.c')
-rw-r--r--4/11.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/4/11.c b/4/11.c
index e6c0645..bb2d1f1 100644
--- a/4/11.c
+++ b/4/11.c
@@ -126,11 +126,11 @@ int getch() { return (bufp > 0) ? buf[--bufp] : getchar(); }
int getop(char s[]) {
int c, i, rc;
- static int pc = EOF;
+ static int pc = ' ';
- if (pc != EOF && pc != ' ' && pc != '\t') {
+ if (pc != ' ' && pc != '\t') {
c = pc;
- pc = EOF;
+ pc = ' ';
} else {
while ((s[0] = c = getch()) == ' ' || c == '\t')
;