From nobody Sat Nov 05 00:31:06 2022 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4N3z1l4GCTz4hB57; Sat, 5 Nov 2022 00:31:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4N3z1l19ytz3LlF; Sat, 5 Nov 2022 00:31:07 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1667608267; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JEymIoKOj5cy64bP84Gd3DM4S4VulpygNo2P5AtAsJg=; b=EFuv3Qz1cQdIaJD7skDj+sezuJWfV0AHJ0vBz1PpmNIhvCR10bWsLfOpbuTuGz2bHciRdI 1MHUvB6/VKiZ2PlDzZ3OiAS+XBHmC1Z0GHDyojw0zeAXvJpJc1JiE00FvfU2vA0w7D3RPA UDqKZsVl+ln1mvzN95KIU3TsSp3JvwldzFiwUxlOn8HppCdxIFeQ2EvdZNaYbB346v5QEz Ep/txBapj7kYu1Ink5ryHcqIoKH4iY6EYXfDT3Yem3MiDBvOML7LCCA56KqWgq2S3Lk/Uz 2klA9og5cXXYXjXpp9/n66Yv6Nzsfdz5+X1uXgC8u0tM/FCiLjpE0HupuUda4g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4N3z1l0J2HzMX8; Sat, 5 Nov 2022 00:31:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 2A50V674071081; Sat, 5 Nov 2022 00:31:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 2A50V6vu071080; Sat, 5 Nov 2022 00:31:06 GMT (envelope-from git) Date: Sat, 5 Nov 2022 00:31:06 GMT Message-Id: <202211050031.2A50V6vu071080@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 15a6febddbf5 - stable/13 - strfmon_test: Reserve space for the null terminator List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 15a6febddbf5f186ca9608cd6f85ded0f666bb12 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1667608267; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JEymIoKOj5cy64bP84Gd3DM4S4VulpygNo2P5AtAsJg=; b=Rhhi0G8hmkhi4rgnyX2ErbWh2yft4m7rUYhSlCnuQJe0O9tNVgcH5wMRYUzEeGordiwUJc WtBl9RYHx3hILQgsBqTGs2cRQ9TRZQJxpLpWxv0forMmIlCf1CCsryR7atE3K6ejfGjrUo Xjz/RUNvNYwK9Lw7a19T8bblIA+jn66Ni2Rj04wKWuvoBfjeBcBwXKYMK3VdmPVRoGO0eu botQbMbyOWYUoPUvrLo1JC/BfyXPvZMz6SW62UYJcE9TiOXEM034iGFz7Hp9n6xbM4k1VJ ss4lSjGMdrB9mz9ZcfNqby5ieffIeAOnAOtc11V1eU/o6rNhVTgKguEcd+xLlQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1667608267; a=rsa-sha256; cv=none; b=mZRnEtBEtVYzw58hiFCrwRbAPITseTQ+KgKHOGgHztrt/+3wHeajPjDIUrXCcEyWuLgwFC 2kWeSTB1R4vSP9YLe+K9gUxuhRVgwGHtz/GMBzjBPfE+HWrWuugZ10Yh4cni55ZazyoWDa /u+j8+HDtN1veEDVdOIWKpxdfo01mcldOGKz9mI/L/ukAcnxKoawe0+wHmkbFVZ3nTpwjH P2mOdcP7TSq8eZ3Bp9N60WnzI6B2iotbQ1UsCTDbUNSWWLuJbuMxK+X0TYS6folvDo93z9 eycIZmbS/4TygV/aHH2N7mufMNsWgmzlaulJ+Aj4JQVRjjper3E/85Ib+M9prQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=15a6febddbf5f186ca9608cd6f85ded0f666bb12 commit 15a6febddbf5f186ca9608cd6f85ded0f666bb12 Author: Jose Luis Duran AuthorDate: 2022-10-27 10:01:24 +0000 Commit: Konstantin Belousov CommitDate: 2022-11-05 00:30:39 +0000 strfmon_test: Reserve space for the null terminator (cherry picked from commit edcee003e5a79386653c8092af3577a112e95451) --- lib/libc/tests/stdlib/strfmon_test.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/libc/tests/stdlib/strfmon_test.c b/lib/libc/tests/stdlib/strfmon_test.c index d8e4f478547a..c2fa6250dc58 100644 --- a/lib/libc/tests/stdlib/strfmon_test.c +++ b/lib/libc/tests/stdlib/strfmon_test.c @@ -55,7 +55,7 @@ ATF_TC_BODY(strfmon_locale_thousands, tc) atf_tc_skip("multi-byte thousands-separator not found"); n = 1234.56; - strfmon(actual, sizeof(actual), "%i", n); + strfmon(actual, sizeof(actual) - 1, "%i", n); strcpy(expected, "1"); strlcat(expected, ts, sizeof(expected)); @@ -95,7 +95,7 @@ ATF_TC_BODY(strfmon_examples, tc) for (i = 0; i < nitems(tests); ++i) { snprintf(format, sizeof(format), "[%s] [%s] [%s]", tests[i].format, tests[i].format, tests[i].format); - strfmon(actual, sizeof(actual), format, + strfmon(actual, sizeof(actual) - 1, format, 123.45, -123.45, 3456.781); ATF_CHECK_STREQ_MSG(tests[i].expected, actual, "[%s]", tests[i].format); @@ -135,7 +135,7 @@ ATF_TC_BODY(strfmon_cs_precedes_0, tc) for (j = 0; j < 5; ++j) { lc->n_sign_posn = j; - strfmon(buf, sizeof(buf), "[%n] ", -123.0); + strfmon(buf, sizeof(buf) - 1, "[%n] ", -123.0); strlcat(actual, buf, sizeof(actual)); } @@ -178,7 +178,7 @@ ATF_TC_BODY(strfmon_cs_precedes_1, tc) for (j = 0; j < 5; ++j) { lc->n_sign_posn = j; - strfmon(buf, sizeof(buf), "[%n] ", -123.0); + strfmon(buf, sizeof(buf) - 1, "[%n] ", -123.0); strlcat(actual, buf, sizeof(actual)); } @@ -206,7 +206,7 @@ ATF_TC_BODY(strfmon_international_currency_code, tc) if (setlocale(LC_MONETARY, tests[i].locale) == NULL) atf_tc_skip("unable to setlocale()"); - strfmon(actual, sizeof(actual), "[%i]", 123.45); + strfmon(actual, sizeof(actual) - 1, "[%i]", 123.45); ATF_CHECK_STREQ(tests[i].expected, actual); } }