Module Name: src Committed By: christos Date: Sat Jun 20 00:16:51 UTC 2020
Modified Files: src/common/lib/libprop: prop_string.c Log Message: Fix lint To generate a diff of this commit: cvs rdiff -u -r1.14 -r1.15 src/common/lib/libprop/prop_string.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/common/lib/libprop/prop_string.c diff -u src/common/lib/libprop/prop_string.c:1.14 src/common/lib/libprop/prop_string.c:1.15 --- src/common/lib/libprop/prop_string.c:1.14 Sat Jun 6 17:25:59 2020 +++ src/common/lib/libprop/prop_string.c Fri Jun 19 20:16:50 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: prop_string.c,v 1.14 2020/06/06 21:25:59 thorpej Exp $ */ +/* $NetBSD: prop_string.c,v 1.15 2020/06/20 00:16:50 christos Exp $ */ /*- * Copyright (c) 2006, 2020 The NetBSD Foundation, Inc. @@ -314,6 +314,7 @@ prop_string_create_format(const char *fm prop_string_t ps; char *str = NULL; int len; + size_t nlen; va_list ap; _PROP_ASSERT(fmt != NULL); @@ -324,16 +325,17 @@ prop_string_create_format(const char *fm if (len < 0) return (NULL); + nlen = len + 1; - str = _PROP_MALLOC(len + 1, M_PROP_STRING); + str = _PROP_MALLOC(nlen, M_PROP_STRING); if (str == NULL) return (NULL); va_start(ap, fmt); - vsnprintf(str, len + 1, fmt, ap); + vsnprintf(str, nlen, fmt, ap); va_end(ap); - ps = _prop_string_instantiate(0, str, len); + ps = _prop_string_instantiate(0, str, (size_t)len); if (ps == NULL) _PROP_FREE(str, M_PROP_STRING);