- Add include for libutil.h and string.h for prototype.

- Cast the rvalue to be compared with the result of
   strlen() to size_t.
This commit is contained in:
delphij 2006-05-25 04:01:04 +00:00
parent 4eb5a7d9ee
commit 43da20f970

View File

@ -32,6 +32,8 @@
#include <sys/module.h> #include <sys/module.h>
#include <errno.h> #include <errno.h>
#include <libutil.h>
#include <string.h>
int int
kld_isloaded(const char *name) kld_isloaded(const char *name)
@ -50,7 +52,7 @@ kld_isloaded(const char *name)
return (1); return (1);
/* strip .ko and try again */ /* strip .ko and try again */
if ((ko = strstr(fstat.name, ".ko")) != NULL && 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) strncmp(fstat.name, name, ko - fstat.name) == 0)
return (1); return (1);
/* look for a matching module within the file */ /* look for a matching module within the file */