From fd57d0395f65ad1e63901d5917c4eb043881dca6 Mon Sep 17 00:00:00 2001 From: Tobias Klauser Date: Sun, 2 Feb 2014 13:31:08 +0100 Subject: trafgen: Don't modify optarg/argv Follow commit bed9b6bb ("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. Signed-off-by: Tobias Klauser --- trafgen.c | 1 - 1 file changed, 1 deletion(-) diff --git a/trafgen.c b/trafgen.c index 6f19677..ea7d983 100644 --- a/trafgen.c +++ b/trafgen.c @@ -1036,7 +1036,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 *= strtol(optarg, NULL, 0); break; -- cgit v1.2.3-54-g00ecf