Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 12 Jul 2016 12:05:58 +0000 (UTC)
From:      Andriy Gapon <avg@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org
Subject:   svn commit: r302662 - vendor-sys/illumos/dist/common/nvpair vendor/illumos/dist/lib/libnvpair
Message-ID:  <201607121205.u6CC5wiJ008387@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: avg
Date: Tue Jul 12 12:05:58 2016
New Revision: 302662
URL: https://svnweb.freebsd.org/changeset/base/302662

Log:
  6447 handful of nvpair cleanups
  
  illumos/illumos-gate@759e89be359f2af635e4122d147df56bce948773
  https://github.com/illumos/illumos-gate/commit/759e89be359f2af635e4122d147df56bce948773
  
  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>

Modified:
  vendor-sys/illumos/dist/common/nvpair/nvpair.c

Changes in other areas also in this revision:
Modified:
  vendor/illumos/dist/lib/libnvpair/libnvpair.c

Modified: vendor-sys/illumos/dist/common/nvpair/nvpair.c
==============================================================================
--- vendor-sys/illumos/dist/common/nvpair/nvpair.c	Tue Jul 12 12:03:00 2016	(r302661)
+++ vendor-sys/illumos/dist/common/nvpair/nvpair.c	Tue Jul 12 12:05:58 2016	(r302662)
@@ -1624,6 +1624,8 @@ nvlist_lookup_nvpair_ei_sep(nvlist_t *nv
 	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 */
@@ -2381,7 +2383,7 @@ nvlist_xpack(nvlist_t *nvl, char **bufp,
 	 */
 	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)



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201607121205.u6CC5wiJ008387>