diff options
author | zlg <zlg@zlg.space> | 2016-06-16 10:15:33 -0700 |
---|---|---|
committer | zlg <zlg@zlg.space> | 2016-06-16 10:15:33 -0700 |
commit | f8d9ff23eb8d3e3286ff5cf4d5f9493532991bb7 (patch) | |
tree | e37b327d7f93435e93a57427600d2b91fbb0cd87 /ch1/1-18_strip-blanks.c | |
parent | Solve Exercise 7-2: Format arbitrary input (diff) | |
download | knr-f8d9ff23eb8d3e3286ff5cf4d5f9493532991bb7.tar.gz knr-f8d9ff23eb8d3e3286ff5cf4d5f9493532991bb7.tar.bz2 knr-f8d9ff23eb8d3e3286ff5cf4d5f9493532991bb7.tar.xz knr-f8d9ff23eb8d3e3286ff5cf4d5f9493532991bb7.zip |
The massive astyle sweep!
Code style should be consistent now. All future commits will be run through
astyle or they will be amended.
Diffstat (limited to 'ch1/1-18_strip-blanks.c')
-rw-r--r-- | ch1/1-18_strip-blanks.c | 3 |
1 files changed, 0 insertions, 3 deletions
diff --git a/ch1/1-18_strip-blanks.c b/ch1/1-18_strip-blanks.c index 947ce8d..2074129 100644 --- a/ch1/1-18_strip-blanks.c +++ b/ch1/1-18_strip-blanks.c @@ -14,7 +14,6 @@ int get_line(char s[], int lim) { int c, i; - for (i = 0; i < lim - 1 && (c = getchar()) != EOF && c != '\n'; ++i) { s[i] = c; } @@ -29,7 +28,6 @@ int get_line(char s[], int lim) { int main(void) { char buffer[MAXLINELENGTH]; int c, i, len; - /* Make sure every line is gone over */ while (len = get_line(buffer, MAXLINELENGTH)) { /* An empty for statement, simply to change the i variable. @@ -37,7 +35,6 @@ int main(void) { * string terminator. */ for (i = len - 2; (i > 0) && (buffer[i] == ' ') || (buffer[i] == '\t'); --i); - /* We've reached the end of the line's actual content. Terminate the line. */ if (i >= 1) { buffer[i + 1] = '\n'; |