- 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:
parent
dcf67e65d2
commit
aa5c5263bc
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=158907
@ -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 */
|
||||
|
Loading…
Reference in New Issue
Block a user