diff options
author | Todd C. Miller <millert@cvs.openbsd.org> | 1996-08-12 21:05:55 +0000 |
---|---|---|
committer | Todd C. Miller <millert@cvs.openbsd.org> | 1996-08-12 21:05:55 +0000 |
commit | 21421744f1e60b2e735f51771bfbcc8cfd029123 (patch) | |
tree | 3072fc560300c230c0c58ceac0edc3d7857c60be /gnu/usr.bin | |
parent | 04da103cb361ea9b303f3185a7c017a21c57856d (diff) |
slightly less gross fix to avoid a coredump.
Diffstat (limited to 'gnu/usr.bin')
-rw-r--r-- | gnu/usr.bin/rcs/src/rcskeys.c | 32 |
1 files changed, 18 insertions, 14 deletions
diff --git a/gnu/usr.bin/rcs/src/rcskeys.c b/gnu/usr.bin/rcs/src/rcskeys.c index 0e6821370f5..1868ebf7106 100644 --- a/gnu/usr.bin/rcs/src/rcskeys.c +++ b/gnu/usr.bin/rcs/src/rcskeys.c @@ -29,6 +29,9 @@ Report problems and direct all questions to: /* * $Log: rcskeys.c,v $ + * Revision 1.3 1996/08/12 21:05:54 millert + * slightly less gross fix to avoid a coredump. + * * Revision 1.2 1996/08/12 20:20:04 millert * fixes core dump if RCSLOCALID not set--oops. * @@ -70,7 +73,7 @@ Report problems and direct all questions to: #include "rcsbase.h" -libId(keysId, "$Id: rcskeys.c,v 1.2 1996/08/12 20:20:04 millert Exp $") +libId(keysId, "$Id: rcskeys.c,v 1.3 1996/08/12 21:05:54 millert Exp $") char const *Keyword[] = { @@ -92,19 +95,20 @@ trymatch(string) register int j; register char const *p, *s; for (j = sizeof(Keyword)/sizeof(*Keyword); (--j); ) { - /* try next keyword */ - if ((p = Keyword[j]) == NULL) - continue; - s = string; - while (*p++ == *s++) { - if (!*p) - switch (*s) { - case KDELIM: - case VDELIM: - return (enum markers)j; - default: - return Nomatch; - } + if (Keyword[j]) { + /* try next keyword */ + p = Keyword[j]; + s = string; + while (*p++ == *s++) { + if (!*p) + switch (*s) { + case KDELIM: + case VDELIM: + return (enum markers)j; + default: + return Nomatch; + } + } } } return(Nomatch); |