summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJerry Jelinek <jerry.jelinek@joyent.com>2015-11-18 11:50:45 +0000
committerJerry Jelinek <jerry.jelinek@joyent.com>2015-11-18 11:50:45 +0000
commitb6ed2bdeb870016106818e9b651a91d00268668c (patch)
treeaadc5b714b9532b94ab839da694cba39d5e19da4
parent4a277bbcaa1b86eae45b5cc62f93f4bdbf4a0962 (diff)
parent759e89be359f2af635e4122d147df56bce948773 (diff)
downloadillumos-joyent-b6ed2bdeb870016106818e9b651a91d00268668c.tar.gz
[illumos-gate merge]
commit 759e89be359f2af635e4122d147df56bce948773 6447 handful of nvpair cleanups
-rw-r--r--usr/src/common/nvpair/nvpair.c4
-rw-r--r--usr/src/lib/libnvpair/libnvpair.c10
2 files changed, 9 insertions, 5 deletions
diff --git a/usr/src/common/nvpair/nvpair.c b/usr/src/common/nvpair/nvpair.c
index 977d262549..4c26d46dd1 100644
--- a/usr/src/common/nvpair/nvpair.c
+++ b/usr/src/common/nvpair/nvpair.c
@@ -1626,6 +1626,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 */
@@ -2383,7 +2385,7 @@ nvlist_xpack(nvlist_t *nvl, char **bufp, size_t *buflen, int encoding,
*/
nv_priv_init(&nvpriv, nva, 0);
- if (err = nvlist_size(nvl, &alloc_size, encoding))
+ if ((err = nvlist_size(nvl, &alloc_size, encoding)))
return (err);
if ((buf = nv_mem_zalloc(&nvpriv, alloc_size)) == NULL)
diff --git a/usr/src/lib/libnvpair/libnvpair.c b/usr/src/lib/libnvpair/libnvpair.c
index 734ec6c2f6..d4d2000028 100644
--- a/usr/src/lib/libnvpair/libnvpair.c
+++ b/usr/src/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>
@@ -211,7 +211,7 @@ NVLIST_PRTFUNC(int32, int32_t, int32_t, "%d")
NVLIST_PRTFUNC(uint32, uint32_t, uint32_t, "0x%x")
NVLIST_PRTFUNC(int64, int64_t, longlong_t, "%lld")
NVLIST_PRTFUNC(uint64, uint64_t, u_longlong_t, "0x%llx")
-NVLIST_PRTFUNC(double, double, double, "0x%llf")
+NVLIST_PRTFUNC(double, double, double, "0x%f")
NVLIST_PRTFUNC(string, char *, char *, "%s")
NVLIST_PRTFUNC(hrtime, hrtime_t, hrtime_t, "0x%llx")
@@ -1229,7 +1229,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, &val_arg);
@@ -1240,7 +1241,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, &val_arg);