aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/libnvpair/libnvpair.c8
-rw-r--r--module/nvpair/nvpair.c2
2 files changed, 7 insertions, 3 deletions
diff --git a/lib/libnvpair/libnvpair.c b/lib/libnvpair/libnvpair.c
index 7e24dd844..0cf38c950 100644
--- a/lib/libnvpair/libnvpair.c
+++ b/lib/libnvpair/libnvpair.c
@@ -24,7 +24,7 @@
*/
#include <unistd.h>
-#include <strings.h>
+#include <string.h>
#include <libintl.h>
#include <sys/types.h>
#include <sys/inttypes.h>
@@ -1219,7 +1219,8 @@ nvpair_value_match_regex(nvpair_t *nvp, int ai,
break;
}
case DATA_TYPE_BOOLEAN_VALUE: {
- boolean_t val, val_arg;
+ int32_t val_arg;
+ boolean_t val;
/* scanf boolean_t from value and check for match */
sr = sscanf(value, "%"SCNi32, (int32_t *)&val_arg);
@@ -1230,7 +1231,8 @@ nvpair_value_match_regex(nvpair_t *nvp, int ai,
break;
}
case DATA_TYPE_BOOLEAN_ARRAY: {
- boolean_t *val_array, val_arg;
+ boolean_t *val_array;
+ int32_t val_arg;
/* check indexed value of array for match */
sr = sscanf(value, "%"SCNi32, (int32_t *)&val_arg);
diff --git a/module/nvpair/nvpair.c b/module/nvpair/nvpair.c
index 24ef61e93..c0155f729 100644
--- a/module/nvpair/nvpair.c
+++ b/module/nvpair/nvpair.c
@@ -1642,6 +1642,8 @@ nvlist_lookup_nvpair_ei_sep(nvlist_t *nvl, const char *name, const char sep,
if ((nvl == NULL) || (name == NULL))
return (EINVAL);
+ sepp = NULL;
+ idx = 0;
/* step through components of name */
for (np = name; np && *np; np = sepp) {
/* ensure unique names */