aboutsummaryrefslogtreecommitdiffstats
path: root/editcap.c
diff options
context:
space:
mode:
authorMartin Kaiser <wireshark@kaiser.cx>2013-10-29 08:34:35 +0000
committerMartin Kaiser <wireshark@kaiser.cx>2013-10-29 08:34:35 +0000
commita876a4306d548f9560e3b719bfa9c008d01fd26a (patch)
treeb6cfe5c8026a4082e3c55bdd74d604f3f0ed54e1 /editcap.c
parentba49d9bcf01a597ebec66c3d65c4813ebf174806 (diff)
From Peter Wu
write editcap debug infos to stderr print some of those messages only in verbose mode https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9342 svn path=/trunk/; revision=52942
Diffstat (limited to 'editcap.c')
-rw-r--r--editcap.c23
1 files changed, 14 insertions, 9 deletions
diff --git a/editcap.c b/editcap.c
index 60f953fdaf..7b09db1653 100644
--- a/editcap.c
+++ b/editcap.c
@@ -276,29 +276,34 @@ add_selection(char *sel)
if (++max_selected >= MAX_SELECTIONS) {
/* Let the user know we stopped selecting */
- printf("Out of room for packet selections!\n");
+ fprintf(stderr, "Out of room for packet selections!\n");
return(FALSE);
}
- printf("Add_Selected: %s\n", sel);
+ if (verbose)
+ fprintf(stderr, "Add_Selected: %s\n", sel);
if ((locn = strchr(sel, '-')) == NULL) { /* No dash, so a single number? */
- printf("Not inclusive ...");
+ if (verbose)
+ fprintf(stderr, "Not inclusive ...");
selectfrm[max_selected].inclusive = 0;
selectfrm[max_selected].first = atoi(sel);
- printf(" %i\n", selectfrm[max_selected].first);
+ if (verbose)
+ fprintf(stderr, " %i\n", selectfrm[max_selected].first);
} else {
- printf("Inclusive ...");
+ if (verbose)
+ fprintf(stderr, "Inclusive ...");
next = locn + 1;
selectfrm[max_selected].inclusive = 1;
selectfrm[max_selected].first = atoi(sel);
selectfrm[max_selected].second = atoi(next);
- printf(" %i, %i\n", selectfrm[max_selected].first,
- selectfrm[max_selected].second);
+ if (verbose)
+ fprintf(stderr, " %i, %i\n", selectfrm[max_selected].first,
+ selectfrm[max_selected].second);
}
return(TRUE);
@@ -1120,7 +1125,7 @@ main(int argc, char *argv[])
}
#ifdef DEBUG
- printf("Optind = %i, argc = %i\n", optind, argc);
+ fprintf(stderr, "Optind = %i, argc = %i\n", optind, argc);
#endif
if ((argc - optind) < 1) {
@@ -1300,7 +1305,7 @@ main(int argc, char *argv[])
|| (selected(count) && keep_em))) {
if (verbose && !dup_detect && !dup_detect_by_time)
- printf("Packet: %u\n", count);
+ fprintf(stderr, "Packet: %u\n", count);
/* We simply write it, perhaps after truncating it; we could
* do other things, like modify it. */