diff options
author | delphij <delphij@FreeBSD.org> | 2006-05-25 04:01:04 +0000 |
---|---|---|
committer | delphij <delphij@FreeBSD.org> | 2006-05-25 04:01:04 +0000 |
commit | 43da20f970c4a3a3a22a78d793897fdf4bf2ed1f (patch) | |
tree | 775218556807bdd372363af3b5a11c569cc8d935 /lib/libutil | |
parent | 4eb5a7d9ee279be7c2af44ea69f761d7ddb4ddaf (diff) | |
download | FreeBSD-src-43da20f970c4a3a3a22a78d793897fdf4bf2ed1f.zip FreeBSD-src-43da20f970c4a3a3a22a78d793897fdf4bf2ed1f.tar.gz |
- Add include for libutil.h and string.h for prototype.
- Cast the rvalue to be compared with the result of
strlen() to size_t.
Diffstat (limited to 'lib/libutil')
-rw-r--r-- | lib/libutil/kld.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/libutil/kld.c b/lib/libutil/kld.c index b8aa9ef..bc80640 100644 --- a/lib/libutil/kld.c +++ b/lib/libutil/kld.c @@ -32,6 +32,8 @@ #include <sys/module.h> #include <errno.h> +#include <libutil.h> +#include <string.h> int kld_isloaded(const char *name) @@ -50,7 +52,7 @@ kld_isloaded(const char *name) return (1); /* strip .ko and try again */ if ((ko = strstr(fstat.name, ".ko")) != NULL && - strlen(name) == ko - fstat.name && + strlen(name) == (size_t)(ko - fstat.name) && strncmp(fstat.name, name, ko - fstat.name) == 0) return (1); /* look for a matching module within the file */ |