Minor size_t!=int related cleanup, only effective on the alpha.

btw: the maximum length of an RE is limited by the "int" range, also
on the alpha. "sopno" is "int", and "int"s are used as counters within
the code, so it would need some work to change this. I only don't know
how one could test it...
This commit is contained in:
drochner 1998-12-13 12:21:46 +00:00
parent 13eaff30ae
commit b6581ead5f
2 changed files with 8 additions and 6 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: regcomp.c,v 1.12 1998/12/08 13:52:48 drochner Exp $ */
/* $NetBSD: regcomp.c,v 1.13 1998/12/13 12:21:46 drochner Exp $ */
/*-
* Copyright (c) 1992, 1993, 1994 Henry Spencer.
@ -44,7 +44,7 @@
#if 0
static char sccsid[] = "@(#)regcomp.c 8.5 (Berkeley) 3/20/94";
#else
__RCSID("$NetBSD: regcomp.c,v 1.12 1998/12/08 13:52:48 drochner Exp $");
__RCSID("$NetBSD: regcomp.c,v 1.13 1998/12/13 12:21:46 drochner Exp $");
#endif
#endif /* LIBC_SCCS and not lint */
@ -692,12 +692,14 @@ struct parse *p;
int invert = 0;
/* Dept of Truly Sickening Special-Case Kludges */
if (p->next + 5 < p->end && strncmp(p->next, "[:<:]]", 6) == 0) {
if (p->next + 5 < p->end && strncmp(p->next, "[:<:]]",
(size_t)6) == 0) {
EMIT(OBOW, 0);
NEXTn(6);
return;
}
if (p->next + 5 < p->end && strncmp(p->next, "[:>:]]", 6) == 0) {
if (p->next + 5 < p->end && strncmp(p->next, "[:>:]]",
(size_t)6) == 0) {
EMIT(OEOW, 0);
NEXTn(6);
return;

View File

@ -1,4 +1,4 @@
/* $NetBSD: regex2.h,v 1.8 1998/12/08 13:41:42 drochner Exp $ */
/* $NetBSD: regex2.h,v 1.9 1998/12/13 12:21:47 drochner Exp $ */
/*-
* Copyright (c) 1992, 1993, 1994 Henry Spencer.
@ -165,7 +165,7 @@ struct re_guts {
cat_t *categories; /* ->catspace[-CHAR_MIN] */
char *must; /* match must contain this string */
int mlen; /* length of must */
size_t nsub; /* copy of re_nsub */
sopno nsub; /* copy of re_nsub */
int backrefs; /* does it use back references? */
sopno nplus; /* how deep does it nest +s? */
/* catspace must be last */