nv.c (256281) | nv.c (260006) |
---|---|
1/*- 2 * Copyright (c) 2009-2010 The FreeBSD Foundation 3 * All rights reserved. 4 * 5 * This software was developed by Pawel Jakub Dawidek under sponsorship from 6 * the FreeBSD Foundation. 7 * 8 * Redistribution and use in source and binary forms, with or without --- 14 unchanged lines hidden (view full) --- 23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 27 * SUCH DAMAGE. 28 */ 29 30#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 2009-2010 The FreeBSD Foundation 3 * All rights reserved. 4 * 5 * This software was developed by Pawel Jakub Dawidek under sponsorship from 6 * the FreeBSD Foundation. 7 * 8 * Redistribution and use in source and binary forms, with or without --- 14 unchanged lines hidden (view full) --- 23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 27 * SUCH DAMAGE. 28 */ 29 30#include <sys/cdefs.h> |
31__FBSDID("$FreeBSD: stable/10/sbin/hastd/nv.c 233392 2012-03-23 20:18:48Z trociny $"); | 31__FBSDID("$FreeBSD: stable/10/sbin/hastd/nv.c 260006 2013-12-28 19:21:22Z trociny $"); |
32 33#include <sys/param.h> 34#include <sys/endian.h> 35 36#include <bitstring.h> 37#include <errno.h> 38#include <stdarg.h> 39#include <stdbool.h> --- 521 unchanged lines hidden (view full) --- 561 562 va_start(nameap, namefmt); 563 nvh = nv_find(nv, NV_TYPE_STRING, namefmt, nameap); 564 va_end(nameap); 565 if (nvh == NULL) 566 return (NULL); 567 PJDLOG_ASSERT((nvh->nvh_type & NV_ORDER_MASK) == NV_ORDER_HOST); 568 PJDLOG_ASSERT(nvh->nvh_dsize >= 1); | 32 33#include <sys/param.h> 34#include <sys/endian.h> 35 36#include <bitstring.h> 37#include <errno.h> 38#include <stdarg.h> 39#include <stdbool.h> --- 521 unchanged lines hidden (view full) --- 561 562 va_start(nameap, namefmt); 563 nvh = nv_find(nv, NV_TYPE_STRING, namefmt, nameap); 564 va_end(nameap); 565 if (nvh == NULL) 566 return (NULL); 567 PJDLOG_ASSERT((nvh->nvh_type & NV_ORDER_MASK) == NV_ORDER_HOST); 568 PJDLOG_ASSERT(nvh->nvh_dsize >= 1); |
569 str = NVH_DATA(nvh); | 569 str = (char *)NVH_DATA(nvh); |
570 PJDLOG_ASSERT(str[nvh->nvh_dsize - 1] == '\0'); 571 PJDLOG_ASSERT(strlen(str) == nvh->nvh_dsize - 1); 572 return (str); 573} 574 575static bool 576nv_vexists(struct nv *nv, const char *namefmt, va_list nameap) 577{ --- 389 unchanged lines hidden --- | 570 PJDLOG_ASSERT(str[nvh->nvh_dsize - 1] == '\0'); 571 PJDLOG_ASSERT(strlen(str) == nvh->nvh_dsize - 1); 572 return (str); 573} 574 575static bool 576nv_vexists(struct nv *nv, const char *namefmt, va_list nameap) 577{ --- 389 unchanged lines hidden --- |