summaryrefslogtreecommitdiffstats
path: root/cddl
diff options
context:
space:
mode:
authormav <mav@FreeBSD.org>2016-10-12 05:44:54 +0000
committermav <mav@FreeBSD.org>2016-10-12 05:44:54 +0000
commit5efe20203026d21468bbd91efa6a490f9963ce0d (patch)
treea071d4bf11c587ae761d7694216802c8a5dbc80e /cddl
parent96cff69653537ba516b37ca4ee5febada518fa94 (diff)
downloadFreeBSD-src-5efe20203026d21468bbd91efa6a490f9963ce0d.zip
FreeBSD-src-5efe20203026d21468bbd91efa6a490f9963ce0d.tar.gz
MFC r305211: MFV r302662: 6447 handful of nvpair cleanups
illumos/illumos-gate@759e89be359f2af635e4122d147df56bce948773 https://github.com/illumos/illumos-gate/commit/759e89be359f2af635e4122d147df56bc e948773 https://www.illumos.org/issues/6447 I got a patch from someone who uses nvpair code outside of illumos. It fixes a couple of gcc warnings/bugs for him. 1. silence uninitialized use warnings 2. add parentheses around assignment used as truth value 3. fix printf format specifier (ll is for integers only) 4. strstr, strspn, strcspn, and strcmp are declared in string.h, not strings.h. 5. avoid scanning integer into boolean variable Reviewed by: Josef 'Jeff' Sipek <jeffpc@josefsipek.net> Reviewed by: Andy Stormont <astormont@racktopsystems.com> Reviewed by: Garrett D'Amore <garrett@damore.org> Approved by: Robert Mustacchi <rm@joyent.com> Author: Steve Dougherty <sdougherty@barracuda.com>
Diffstat (limited to 'cddl')
-rw-r--r--cddl/contrib/opensolaris/lib/libnvpair/libnvpair.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/cddl/contrib/opensolaris/lib/libnvpair/libnvpair.c b/cddl/contrib/opensolaris/lib/libnvpair/libnvpair.c
index 7ad5141..c6fbfe9 100644
--- a/cddl/contrib/opensolaris/lib/libnvpair/libnvpair.c
+++ b/cddl/contrib/opensolaris/lib/libnvpair/libnvpair.c
@@ -26,7 +26,7 @@
#include <solaris.h>
#include <inttypes.h>
#include <unistd.h>
-#include <strings.h>
+#include <string.h>
#include <libintl.h>
#include <stdarg.h>
#include "libnvpair.h"
@@ -1228,7 +1228,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);
@@ -1239,7 +1240,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);
OpenPOWER on IntegriCloud