Skip to content

Commit d2de3d7

Browse files
authored
Fixed minor issue getop.c
Changed '!=' to '==' so the skip white spaces thing happens.
1 parent 7f3097e commit d2de3d7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

chapter_5/exercise_5_06/getop.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ int getop(char *s)
2222
char c;
2323

2424
// Skip blanks (spaces and tabs)
25-
while ((*s = c = getchar()) != ' ' || c != '\t')
25+
while ((*s = c = getchar()) == ' ' || c == '\t')
2626
;
2727

2828
*(s + 1) = '\0';

0 commit comments

Comments
 (0)