Skip to content

Commit

Permalink
Fixed minor issue getop.c
Browse files Browse the repository at this point in the history
Changed '!=' to '==' so the skip white spaces thing happens.
  • Loading branch information
sadeem-albir authored Mar 22, 2024
1 parent 7f3097e commit d2de3d7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion chapter_5/exercise_5_06/getop.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ int getop(char *s)
char c;

// Skip blanks (spaces and tabs)
while ((*s = c = getchar()) != ' ' || c != '\t')
while ((*s = c = getchar()) == ' ' || c == '\t')
;

*(s + 1) = '\0';
Expand Down

0 comments on commit d2de3d7

Please sign in to comment.