aboutsummaryrefslogtreecommitdiffstats
path: root/colorize.c
diff options
context:
space:
mode:
authorGravatar Steven Schubiger <stsc@refcnt.org> 2013-11-21 21:41:59 +0100
committerGravatar Steven Schubiger <stsc@refcnt.org> 2013-11-21 21:41:59 +0100
commit6df8f3534b2f5a99c43fdeefacf33b439591cccc (patch)
tree8db3ad9b2618b89ed5896d7bee5dee568b03d2d7 /colorize.c
parent089b98b96832d3cc3eb5cfd5735110aa3f9fb16a (diff)
downloadcolorize-6df8f3534b2f5a99c43fdeefacf33b439591cccc.tar.gz
colorize-6df8f3534b2f5a99c43fdeefacf33b439591cccc.tar.bz2
Improve determining buffer size
Diffstat (limited to 'colorize.c')
-rw-r--r--colorize.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/colorize.c b/colorize.c
index 233c092..793da29 100644
--- a/colorize.c
+++ b/colorize.c
@@ -56,9 +56,11 @@
#define free_null(ptr) free_wrap((void **)&ptr)
#define xstrdup(str) strdup_wrap(str)
-#if !defined BUF_SIZE || BUF_SIZE <= 0
+#if BUF_SIZE <= 1 /* BUF_SIZE - 1 */
# undef BUF_SIZE
-# define BUF_SIZE 4096 + 1
+#endif
+#ifndef BUF_SIZE
+# define BUF_SIZE 4096
#endif
#define LF 0x01
@@ -380,7 +382,7 @@ print_version (void)
c_flags = "unknown";
#endif
printf ("Compiler flags: %s\n", c_flags);
- printf ("Buffer size: %u bytes\n", BUF_SIZE - 1);
+ printf ("Buffer size: %u bytes\n", BUF_SIZE);
}
static void