aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXin LI <delphij@FreeBSD.org>2006-05-25 04:01:04 +0000
committerXin LI <delphij@FreeBSD.org>2006-05-25 04:01:04 +0000
commitaa5c5263bc64fa889f2552c4eed2811580e00a20 (patch)
tree775218556807bdd372363af3b5a11c569cc8d935
parentdcf67e65d2b58a3b0d31d275cacb4c038ba7ecee (diff)
- Add include for libutil.h and string.h for prototype.
- Cast the rvalue to be compared with the result of strlen() to size_t.
Notes
Notes: svn path=/head/; revision=158907
-rw-r--r--lib/libutil/kld.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/libutil/kld.c b/lib/libutil/kld.c
index b8aa9efb0103..bc806409f10e 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 */