aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorzlg <zlg@zlg.space>2012-11-29 12:02:35 -0600
committerzlg <zlg@zlg.space>2012-11-29 12:02:35 -0600
commit5474f7b679879edb05fb03452886dedff8e27f36 (patch)
tree0117886f953f6c0c8b95beffe2a8ece06933939b
parentSolve Exercise 1-21: entab (diff)
downloadknr-5474f7b679879edb05fb03452886dedff8e27f36.tar.gz
knr-5474f7b679879edb05fb03452886dedff8e27f36.tar.bz2
knr-5474f7b679879edb05fb03452886dedff8e27f36.tar.xz
knr-5474f7b679879edb05fb03452886dedff8e27f36.zip
Correct 1-13's chart heading
Thanks to ##c's rizlah
Diffstat (limited to '')
-rw-r--r--1-13_word-length-histogram.c9
-rw-r--r--1-21_entab.c1
2 files changed, 8 insertions, 2 deletions
diff --git a/1-13_word-length-histogram.c b/1-13_word-length-histogram.c
index 1b4cdc0..1e21378 100644
--- a/1-13_word-length-histogram.c
+++ b/1-13_word-length-histogram.c
@@ -52,8 +52,13 @@ int main(void) {
/* Everything that's input counts as a letter. */
++ltrs;
}
- // This is ugly and I wish I knew a better way to do it.
- printf("\nWORD LENGTH FREQUENCY\n\n 5 10 15 20 25 30 35 40 45 50 55 60 65 70 75\n");
+
+ printf("\nWORD LENGTH FREQUENCY\n ");
+ for (i = 5; i < 80; i += 5) {
+ printf(" %2d", i);
+ }
+
+ printf("\n"); // End the chart heading.
int iter;
iter = MINWLENGTH;
while (iter <= MAXWLENGTH) {
diff --git a/1-21_entab.c b/1-21_entab.c
index 595f583..0f25706 100644
--- a/1-21_entab.c
+++ b/1-21_entab.c
@@ -42,4 +42,5 @@ int main(void) {
putchar(c);
}
}
+ return 0;
}
82fc521c6af2c38154b05a36306b92093&follow=1'>Make VGSTASH_DB_LOCATION point to a filezlg2-21/+20 It used to point to a directory, which would then look for .vgstash.db. This behavior was kind of backwards and I don't remember why I did it that way. This change gives users more control over where they put their DB. Be sure to update your environment variable if you have it set! 2016-11-18Remove settings from helpers.shZe Libertine Gamer1-5/+0 Sourcing them in .bash_profile screws up login if they're set. 2016-11-15Correct phrasing in README.Ze Libertine Gamer1-4/+4 2016-11-13DerpZe Libertine Gamer1-0/+1 2016-11-03Improve error handling in shell scriptsZe Libertine Gamer4-3/+23 2016-10-24Correct run_again, add recursionZe Libertine Gamer1-0/+4 Loops and functions -- oh my, what a useful combination. :) 2016-10-21Add quotes to correct behavior for arglistZe Libertine Gamer1-1/+1 2016-10-14updater.sh: add recursion, error handlingZe Libertine Gamer1-43/+101 2016-10-14Correct pipe-handling behaviorZe Libertine Gamer1-1/+9 2016-10-12Clarify a method to move between platformsZe Libertine Gamer1-2/+5 Also correct a typo.