From f8d9ff23eb8d3e3286ff5cf4d5f9493532991bb7 Mon Sep 17 00:00:00 2001 From: zlg Date: Thu, 16 Jun 2016 10:15:33 -0700 Subject: The massive astyle sweep! Code style should be consistent now. All future commits will be run through astyle or they will be amended. --- ch5/5-11_entab-remixed.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'ch5/5-11_entab-remixed.c') diff --git a/ch5/5-11_entab-remixed.c b/ch5/5-11_entab-remixed.c index 8f6f7d4..d517365 100644 --- a/ch5/5-11_entab-remixed.c +++ b/ch5/5-11_entab-remixed.c @@ -21,17 +21,14 @@ int main(int argc, char *argv[]) { int column, c, spaces, tabnum, stop; spaces = column = 0; - if (argc > 1) { tabnum = 1; stop = atoi(argv[tabnum]); } else { tabnum = 0; } - while ((c = getchar()) != EOF) { column++; - if (c == ' ') { spaces++; if (argc > 1) { @@ -43,11 +40,11 @@ int main(int argc, char *argv[]) { putchar('\t'); spaces = 0; } - } else if (column > stop && tabnum < (argc -1)) { + } else if (column > stop && tabnum < (argc - 1)) { stop = atoi(argv[++tabnum]); } } else { - // we need to do default tabstopping + // we need to do default tabstopping if (column % TABWIDTH == 0 && spaces > 1) { putchar('\t'); spaces = 0; @@ -71,6 +68,5 @@ int main(int argc, char *argv[]) { putchar(c); } } - return 0; } -- cgit v1.2.3-54-g00ecf