From bed9b6bb58f83775a71361ef9f4f11f61afe452c Mon Sep 17 00:00:00 2001 From: Tobias Klauser Date: Thu, 10 Oct 2013 11:14:26 +0200 Subject: netsniff-ng: Don't modify optarg/argv We shouldn't modify optarg (and thus argv) since it's e.g. used to display the commandline string in `ps'. Since strtoul() reads until it encounters the first non-numeric character and ignores the rest, we can just revert from setting a NULL byte after the numeric part of the string. Reported-by: Jon Schipp Signed-off-by: Tobias Klauser --- netsniff-ng.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/netsniff-ng.c b/netsniff-ng.c index 50a9f75..c5966b1 100644 --- a/netsniff-ng.c +++ b/netsniff-ng.c @@ -1215,7 +1215,6 @@ int main(int argc, char **argv) ctx.reserve_size = 1 << 30; else panic("Syntax error in ring size param!\n"); - *ptr = 0; ctx.reserve_size *= strtoul(optarg, NULL, 0); break; @@ -1301,7 +1300,6 @@ int main(int argc, char **argv) panic("Syntax error in time/size param!\n"); } - *ptr = 0; ctx.dump_interval *= strtoul(optarg, NULL, 0); break; case 'V': -- cgit v1.2.3-54-g00ecf