aboutsummaryrefslogtreecommitdiff
path: root/1-17_over-80.c
diff options
context:
space:
mode:
authorzlg <zlg@zlg.space>2013-01-09 01:10:15 -0600
committerzlg <zlg@zlg.space>2013-01-09 01:10:15 -0600
commit1f7068ac3281c0651c876d99612432a36c298f90 (patch)
tree34f1f5347390ccc04a052470c27909d50687e707 /1-17_over-80.c
parentClean up 1-13 and 1-20, correct 1-21 (diff)
downloadknr-1f7068ac3281c0651c876d99612432a36c298f90.tar.gz
knr-1f7068ac3281c0651c876d99612432a36c298f90.tar.bz2
knr-1f7068ac3281c0651c876d99612432a36c298f90.tar.xz
knr-1f7068ac3281c0651c876d99612432a36c298f90.zip
Solve Exercise 1-22: wordwrap
* Removed unnecessary get_line() function in 1-17 * Corrected grammar in README, added an acknowledgement
Diffstat (limited to '1-17_over-80.c')
-rw-r--r--1-17_over-80.c15
1 files changed, 0 insertions, 15 deletions
diff --git a/1-17_over-80.c b/1-17_over-80.c
index dcf7058..53f00ce 100644
--- a/1-17_over-80.c
+++ b/1-17_over-80.c
@@ -2,21 +2,6 @@
#define MINLENGTH 80
-/* Read as much as possible of a string and return its length. */
-int get_line(char s[]) {
- int c, i;
-
- for (i = 0; i < MINLENGTH - 1 && (c = getchar()) != EOF; ++i) {
- s[i] = c;
- }
- if (c == '\n') {
- s[i] = c;
- ++i;
- }
- s[i] = '\0';
- return i;
-}
-
int main() {
// longline is used as a boolean that tells us if it's a line worth printing
int longline = 0;