1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
|
$NetBSD: patch-al,v 1.1 2002/08/08 17:49:00 wiz Exp $
--- portmon/portmon.c.orig Thu Apr 6 21:32:26 2000
+++ portmon/portmon.c
@@ -180,7 +180,7 @@ main(ac, av)
else
{
update_event(&v, harray[i]->status,
- /* value */ (u_long)(harray[i]->status),
+ /* value */ (u_long)(harray[i]->elapsedsecs),
harray[i]->testseverity) ;
lseek(fdout, -(off_t)sizeof(v), SEEK_CUR);
write(fdout, (char *)&v, sizeof(v));
@@ -658,16 +658,21 @@ static char *Strcasestr(haystack, needle
s1 = haystack; s2 = needle; n = needlelen;
do
{
- if (tolower(*s1) != tolower(*s2++) || *s1 == 0) /* */
+ if (*s1 == 0 || tolower(*s1) != tolower(*s2++)) /* */
break;
++s1;
} while (--n != 0);
- if (n == 0 || *s1 == 0)
- break; /* found, break out of forever loop */
+ if (n == 0) {
+ --haystack;
+ break; /* found, break out of forever loop */
+ }
+ if (*s1 == 0) {
+ haystack = NULL;
+ break; /* not found, break out of forever loop */
+ }
} /* end for */
- haystack--;
return ((char *)haystack);
} /* Strcasestr() */
|