diff options
Diffstat (limited to 'src/lib/libc/string/bm.c')
| -rw-r--r-- | src/lib/libc/string/bm.c | 38 |
1 files changed, 13 insertions, 25 deletions
diff --git a/src/lib/libc/string/bm.c b/src/lib/libc/string/bm.c index 68eac22ecc..6c8e4c3472 100644 --- a/src/lib/libc/string/bm.c +++ b/src/lib/libc/string/bm.c | |||
| @@ -13,11 +13,7 @@ | |||
| 13 | * 2. Redistributions in binary form must reproduce the above copyright | 13 | * 2. Redistributions in binary form must reproduce the above copyright |
| 14 | * notice, this list of conditions and the following disclaimer in the | 14 | * notice, this list of conditions and the following disclaimer in the |
| 15 | * documentation and/or other materials provided with the distribution. | 15 | * documentation and/or other materials provided with the distribution. |
| 16 | * 3. All advertising materials mentioning features or use of this software | 16 | * 3. Neither the name of the University nor the names of its contributors |
| 17 | * must display the following acknowledgement: | ||
| 18 | * This product includes software developed by the University of | ||
| 19 | * California, Berkeley and its contributors. | ||
| 20 | * 4. Neither the name of the University nor the names of its contributors | ||
| 21 | * may be used to endorse or promote products derived from this software | 17 | * may be used to endorse or promote products derived from this software |
| 22 | * without specific prior written permission. | 18 | * without specific prior written permission. |
| 23 | * | 19 | * |
| @@ -34,10 +30,9 @@ | |||
| 34 | * SUCH DAMAGE. | 30 | * SUCH DAMAGE. |
| 35 | */ | 31 | */ |
| 36 | 32 | ||
| 37 | #ifndef lint | 33 | #if defined(LIBC_SCCS) && !defined(lint) |
| 38 | /* from: static char sccsid[] = "@(#)bm.c 8.7 (Berkeley) 6/21/94"; */ | 34 | static char *rcsid = "$OpenBSD: bm.c,v 1.5 2005/03/30 20:13:52 otto Exp $"; |
| 39 | static char *rcsid = "$Id: bm.c,v 1.1.1.1 1995/10/18 08:42:20 deraadt Exp $"; | 35 | #endif /* LIBC_SCCS and not lint */ |
| 40 | #endif /* not lint */ | ||
| 41 | 36 | ||
| 42 | #include <sys/types.h> | 37 | #include <sys/types.h> |
| 43 | 38 | ||
| @@ -90,14 +85,11 @@ static u_char const freq_def[256] = { | |||
| 90 | }; | 85 | }; |
| 91 | 86 | ||
| 92 | bm_pat * | 87 | bm_pat * |
| 93 | bm_comp(pb, len, freq) | 88 | bm_comp(u_char const *pb, size_t len, u_char const *freq) |
| 94 | u_char const *pb; | ||
| 95 | size_t len; | ||
| 96 | u_char const *freq; | ||
| 97 | { | 89 | { |
| 98 | register u_char const *pe, *p; | 90 | u_char const *pe, *p; |
| 99 | register size_t *d, r; | 91 | size_t *d, r; |
| 100 | register int j; | 92 | int j; |
| 101 | int sv_errno; | 93 | int sv_errno; |
| 102 | bm_pat *pat; | 94 | bm_pat *pat; |
| 103 | 95 | ||
| @@ -147,8 +139,7 @@ mem: sv_errno = errno; | |||
| 147 | } | 139 | } |
| 148 | 140 | ||
| 149 | void | 141 | void |
| 150 | bm_free(pat) | 142 | bm_free(bm_pat *pat) |
| 151 | bm_pat *pat; | ||
| 152 | { | 143 | { |
| 153 | if (pat->pat != NULL) | 144 | if (pat->pat != NULL) |
| 154 | free(pat->pat); | 145 | free(pat->pat); |
| @@ -158,14 +149,11 @@ bm_free(pat) | |||
| 158 | } | 149 | } |
| 159 | 150 | ||
| 160 | u_char * | 151 | u_char * |
| 161 | bm_exec(pat, base, n) | 152 | bm_exec(bm_pat *pat, u_char *base, size_t n) |
| 162 | bm_pat *pat; | ||
| 163 | u_char *base; | ||
| 164 | size_t n; | ||
| 165 | { | 153 | { |
| 166 | register u_char *e, *ep, *p, *q, *s; | 154 | u_char *e, *ep, *p, *q, *s; |
| 167 | register size_t *d0, k, md2, n1, ro; | 155 | size_t *d0, k, md2, n1, ro; |
| 168 | register int rc; | 156 | int rc; |
| 169 | 157 | ||
| 170 | if (n == 0) | 158 | if (n == 0) |
| 171 | return (NULL); | 159 | return (NULL); |
