diff options
Diffstat (limited to 'contrib/ntp/libparse/parse.c')
-rw-r--r-- | contrib/ntp/libparse/parse.c | 54 |
1 files changed, 43 insertions, 11 deletions
diff --git a/contrib/ntp/libparse/parse.c b/contrib/ntp/libparse/parse.c index d3712b6..dfbbaa6 100644 --- a/contrib/ntp/libparse/parse.c +++ b/contrib/ntp/libparse/parse.c @@ -1,7 +1,7 @@ /* - * /src/NTP/ntp-4/libparse/parse.c,v 4.14 1999/11/28 09:13:52 kardel RELEASE_19991128_A + * /src/NTP/ntp4-dev/libparse/parse.c,v 4.20 2005/08/06 17:39:40 kardel RELEASE_20050806_A * - * parse.c,v 4.14 1999/11/28 09:13:52 kardel RELEASE_19991128_A + * parse.c,v 4.20 2005/08/06 17:39:40 kardel RELEASE_20050806_A * * Parser module for reference clock * @@ -11,12 +11,32 @@ * a struct timeval. * when PARSEKERNEL is not defined NTP time stamps will be used. * - * Copyright (c) 1992-1998 by Frank Kardel - * Friedrich-Alexander Universität Erlangen-Nürnberg, Germany - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * Copyright (c) 1995-2005 by Frank Kardel <kardel <AT> ntp.org> + * Copyright (c) 1989-1994 by Frank Kardel, Friedrich-Alexander Universität Erlangen-Nürnberg, Germany + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the author nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. * */ @@ -27,7 +47,7 @@ #if defined(REFCLOCK) && defined(CLOCK_PARSE) #if !(defined(lint) || defined(__GNUC__)) -static char rcsid[] = "parse.c,v 4.14 1999/11/28 09:13:52 kardel RELEASE_19991128_A"; +static char rcsid[] = "parse.c,v 4.20 2005/08/06 17:39:40 kardel RELEASE_20050806_A"; #endif #include "ntp_fp.h" @@ -189,7 +209,7 @@ parse_restart( */ parseio->parse_data[parseio->parse_index] = '\0'; memcpy(parseio->parse_ldata, parseio->parse_data, (unsigned)(parseio->parse_index+1)); - parseio->parse_ldsize = parseio->parse_index+1; + parseio->parse_ldsize = parseio->parse_index; updated = PARSE_INP_TIME; } @@ -234,7 +254,7 @@ parse_end( */ parseio->parse_data[parseio->parse_index] = '\0'; memcpy(parseio->parse_ldata, parseio->parse_data, (unsigned)(parseio->parse_index+1)); - parseio->parse_ldsize = parseio->parse_index+1; + parseio->parse_ldsize = parseio->parse_index; parseio->parse_index = 0; parseprintf(DD_PARSE, ("parse: parse_end: buffer end\n")); return PARSE_INP_TIME; @@ -866,6 +886,18 @@ int parse_bs; * History: * * parse.c,v + * Revision 4.20 2005/08/06 17:39:40 kardel + * cleanup size handling wrt/ to buffer boundaries + * + * Revision 4.19 2005/04/16 17:32:10 kardel + * update copyright + * + * Revision 4.18 2004/11/14 16:11:05 kardel + * update Id tags + * + * Revision 4.17 2004/11/14 15:29:41 kardel + * support PPSAPI, upgrade Copyright to Berkeley style + * * Revision 4.14 1999/11/28 09:13:52 kardel * RECON_4_0_98F * |