aboutsummaryrefslogtreecommitdiff
path: root/ch1/1-18_strip-blanks.c
diff options
context:
space:
mode:
authorzlg <zlg@zlg.space>2016-06-16 10:15:33 -0700
committerzlg <zlg@zlg.space>2016-06-16 10:15:33 -0700
commitf8d9ff23eb8d3e3286ff5cf4d5f9493532991bb7 (patch)
treee37b327d7f93435e93a57427600d2b91fbb0cd87 /ch1/1-18_strip-blanks.c
parentSolve Exercise 7-2: Format arbitrary input (diff)
downloadknr-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.c3
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';