From f13b347e88158f320b6d26c201954533f496564f Mon Sep 17 00:00:00 2001 From: laforge Date: Thu, 14 Feb 2002 23:47:54 +0000 Subject: fix for psd-delay-threshold > 100 --- extensions/libipt_psd.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/extensions/libipt_psd.c b/extensions/libipt_psd.c index 0b8b487..de1fc76 100644 --- a/extensions/libipt_psd.c +++ b/extensions/libipt_psd.c @@ -82,12 +82,11 @@ parse(int c, char **argv, int invert, unsigned int *flags, { struct ipt_psd_info *psdinfo = (struct ipt_psd_info *)(*match)->data; unsigned int num; - char storage[sizeof(optarg) + 1]; + char storage[strlen(optarg) + 2]; - /* string_to_number needs this */ + /* string_to_number needs a leading space */ storage[0] = ' '; - strncpy(&storage[1], optarg, (size_t) sizeof(optarg)); - storage[sizeof(optarg)] = 0; + strcpy(&storage[1], optarg); switch (c) { /* PSD-weight-threshold */ -- cgit v1.2.3