From owner-svn-src-all@FreeBSD.ORG Fri Dec 5 23:43:16 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 139BCA07; Fri, 5 Dec 2014 23:43:16 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F3F7CA80; Fri, 5 Dec 2014 23:43:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sB5NhF11013542; Fri, 5 Dec 2014 23:43:15 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB5NhFmH013541; Fri, 5 Dec 2014 23:43:15 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201412052343.sB5NhFmH013541@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Fri, 5 Dec 2014 23:43:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r275532 - vendor/illumos/dist/lib/libnvpair X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Dec 2014 23:43:16 -0000 Author: delphij Date: Fri Dec 5 23:43:15 2014 New Revision: 275532 URL: https://svnweb.freebsd.org/changeset/base/275532 Log: 5005 libnvpair JSON output broken by lint fixes 5006 libnvpair JSON cannot print int16 arrays Reviewed by: Robert Mustacchi Approved by: Gordon Ross Author: Joshua M. Clulow illumos/illumos-gate@37c79205ad46187f54b2edbf6a468160935f14d9 Modified: vendor/illumos/dist/lib/libnvpair/nvpair_json.c Modified: vendor/illumos/dist/lib/libnvpair/nvpair_json.c ============================================================================== --- vendor/illumos/dist/lib/libnvpair/nvpair_json.c Fri Dec 5 23:08:39 2014 (r275531) +++ vendor/illumos/dist/lib/libnvpair/nvpair_json.c Fri Dec 5 23:43:15 2014 (r275532) @@ -9,7 +9,7 @@ * http://www.illumos.org/license/CDDL. */ /* - * Copyright (c) 2013, Joyent, Inc. All rights reserved. + * Copyright (c) 2014, Joyent, Inc. */ #include @@ -20,9 +20,11 @@ #include "libnvpair.h" -#define FPRINTF(fp, ...) \ - if (fprintf(fp, __VA_ARGS__) < 0) \ - return (-1) \ +#define FPRINTF(fp, ...) \ + do { \ + if (fprintf(fp, __VA_ARGS__) < 0) \ + return (-1); \ + } while (0) /* * When formatting a string for JSON output we must escape certain characters, @@ -328,7 +330,7 @@ nvlist_print_json(FILE *fp, nvlist_t *nv for (i = 0; i < valsz; i++) { if (i > 0) FPRINTF(fp, ","); - FPRINTF(fp, "%hhd", val[i]); + FPRINTF(fp, "%hd", val[i]); } FPRINTF(fp, "]"); break;