[PATCH] Ntpd config file support

2014-03-22 Thread ibid . ag
Hello, I got tired of hearing numbers thrown around without basis in a 4-5 day old thread when the subject was probably trivial, so I wrote a parser for ntp.conf this morning. This version falls back to /etc/ntp.conf when -p is not specified; if -p is specified, ntp.conf is ignored. Only lines

Re: [PATCH] Ntpd config file support

2014-03-22 Thread Harald Becker
Hi Isaac ! Your program will fail on lines starting with the word server (eg. serverxyz), that is it does not check for clear word boundary and gives wrong results in that case. while (cbuf[i] 35) i++; Unwise to do this in a not poor ASCII environment, as most systems are nowadays. This way

Re: [PATCH] Ntpd config file support

2014-03-22 Thread Ralf Friedl
Harald Becker wrote: Your program will fail on lines starting with the word server (eg. serverxyz), that is it does not check for clear word boundary and gives wrong results in that case. The program will not fail for serverxyz, it will add a server xyz. This may be a bug or a feature :-)

Re: [PATCH] Ntpd config file support

2014-03-22 Thread Rich Felker
On Sat, Mar 22, 2014 at 08:59:28PM +0100, Ralf Friedl wrote: Harald Becker wrote: Your program will fail on lines starting with the word server (eg. serverxyz), that is it does not check for clear word boundary and gives wrong results in that case. The program will not fail for serverxyz, it

Re: [PATCH] Ntpd config file support

2014-03-22 Thread Bernhard Reutner-Fischer
On 22 March 2014 21:27:51 Rich Felker dal...@aerifal.cx wrote: On Sat, Mar 22, 2014 at 08:59:28PM +0100, Ralf Friedl wrote: Harald Becker wrote: Your program will fail on lines starting with the word server (eg. serverxyz), that is it does not check for clear word boundary and gives wrong