diff options
author | alfred <alfred@FreeBSD.org> | 2001-04-01 07:36:28 +0000 |
---|---|---|
committer | alfred <alfred@FreeBSD.org> | 2001-04-01 07:36:28 +0000 |
commit | 2b9c29467dbaa8502fe34679f7b6e456b867b23c (patch) | |
tree | 46f5b5fe3f96d5620acaea5570ae75aad52260c9 /sys | |
parent | 713513e1e6f0d0de9754f4a9442f95822584d759 (diff) | |
download | FreeBSD-src-2b9c29467dbaa8502fe34679f7b6e456b867b23c.zip FreeBSD-src-2b9c29467dbaa8502fe34679f7b6e456b867b23c.tar.gz |
make code use strxxx() calls
Glanced at by: imp
Diffstat (limited to 'sys')
-rw-r--r-- | sys/dev/ppbus/ppbconf.c | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/sys/dev/ppbus/ppbconf.c b/sys/dev/ppbus/ppbconf.c index b494405..17a2114 100644 --- a/sys/dev/ppbus/ppbconf.c +++ b/sys/dev/ppbus/ppbconf.c @@ -173,8 +173,6 @@ static char *pnp_classes[] = { * search_token() * * Search the first occurence of a token within a string - * - * XXX should use strxxx() calls */ static char * search_token(char *str, int slen, char *token) @@ -186,21 +184,15 @@ search_token(char *str, int slen, char *token) if (slen == UNKNOWN_LENGTH) /* get string's length */ - for (slen = 0, p = str; *p != '\0'; p++) - slen ++; + slen = strlen(str); /* get token's length */ - for (tlen = 0, p = token; *p != '\0'; p++) - tlen ++; - + tlen = strlen(token); if (tlen == 0) return (str); for (i = 0; i <= slen-tlen; i++) { - for (j = 0; j < tlen; j++) - if (str[i+j] != token[j]) - break; - if (j == tlen) + if (strncmp(str + i, token, tlen) == 0) return (&str[i]); } |