Subject: time compar in talkd
To: None <current-users@NetBSD.ORG>
From: Alan Peakall <alan@parsys.co.uk>
List: current-users
Date: 07/08/1996 12:35:47
In function `find_match()' of `[libexec]/[talkd]/table.c' there is code
(near line 89) reading:
gettimeofday(&tp, &txp);
current_time = tp.tv_sec;
if (debug)
print_request("find_match", request);
for (ptr = table; ptr != NIL; ptr = ptr->next) {
if ((ptr->time - current_time) > MAX_LIFE) {
/* the entry is too old */
I believe the sense of the subtraction in the predicate to the second
`if' is back to front. Could this be checked ?
As `difftime()' is not a macro, I would not be so fussy as demand its use :-)
- alan
------------------------------------------------------------------------
Alan Peakall, applications engineer Parsys Ltd
Email: alan@parsys.co.uk London W7 2QE, United Kingdom
Tel: +44 181 5798683 Fax: +44 181 5798365