]> git.refcnt.org Git - colorize.git/commitdiff
Improve determining buffer size
authorSteven Schubiger <stsc@refcnt.org>
Thu, 21 Nov 2013 20:41:59 +0000 (21:41 +0100)
committerSteven Schubiger <stsc@refcnt.org>
Thu, 21 Nov 2013 20:41:59 +0000 (21:41 +0100)
colorize.c

index 233c092ad09c47e0126371ace6fc5f3cd1d35b90..793da296455f6c02d1dc60c023b3a793d3a329b5 100644 (file)
 #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