Added compile time flag for verbose
authorviric@llimona
Wed, 04 Jul 2007 21:44:29 +0200
changeset 11 0ef0d9c52f82
parent 10 298a76a0154b
child 12 f81dd70a9b0b
Added compile time flag for verbose
sreplace.c
--- a/sreplace.c	Wed Jul 04 21:43:09 2007 +0200
+++ b/sreplace.c	Wed Jul 04 21:44:29 2007 +0200
@@ -10,6 +10,8 @@
 
 #include "sreplace.h"
 
+const int verbose = 0;
+
 enum {
   BUFFER_SIZE = 2048
 };
@@ -249,14 +251,20 @@
   new_str.ptr = argv[2];
 
   old_str.length = parse_backslashes(old_str.ptr);
-  fprintf(stderr, "OLD: ");
-  print_hex(stderr, &old_str);
-  fprintf(stderr, "\n");
+  if (verbose)
+  {
+      fprintf(stderr, "OLD: ");
+      print_hex(stderr, &old_str);
+      fprintf(stderr, "\n");
+  }
 
   new_str.length = parse_backslashes(new_str.ptr);
-  fprintf(stderr, "NEW: ");
-  print_hex(stderr, &new_str);
-  fprintf(stderr, "\n");
+  if (verbose)
+  {
+      fprintf(stderr, "NEW: ");
+      print_hex(stderr, &new_str);
+      fprintf(stderr, "\n");
+  }
 }
 
 int main(int argc, char ** argv)