From: Peter Rosin Date: Fri, 8 Aug 2003 09:43:34 +0000 (+0200) Subject: Correctly remove trailing space from arguments of incoming X-Git-Tag: NTP_4_2_0~2^2~1 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=ad5dbe189c18254b35d27f54e8d9fc5fdf9cfeb9;p=thirdparty%2Fntp.git Correctly remove trailing space from arguments of incoming request variables. bk: 3f3370c6JlMWTU_kx0ej_-7QRzAIcw --- diff --git a/ntpd/ntp_control.c b/ntpd/ntp_control.c index 9f061926a7..a06dd50628 100644 --- a/ntpd/ntp_control.c +++ b/ntpd/ntp_control.c @@ -1884,10 +1884,10 @@ ctl_getitem( if (cp < reqend) cp++; *tp-- = '\0'; - while (tp > buf) { - *tp-- = '\0'; + while (tp >= buf) { if (!isspace((int)(*tp))) break; + *tp-- = '\0'; } reqpt = cp; *data = buf;