pkgsrc/net/nocol/patches/patch-al
wiz e8eff0b5b1 Update to 4.3.1nb3: add patch sent in from Mishka in private mail,
closing pkg/17833.  Fixes Strcasestr, and improves diagnostic message.
2002-08-08 17:48:59 +00:00

39 lines
1.1 KiB
Text

$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() */