From nobody Wed Jun 14 23:01:12 2023 X-Original-To: dev-commits-src-main@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 4QhLWY1b7xz4cZy3; Wed, 14 Jun 2023 23:01:13 +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 4QhLWY15Dnz4W5B; Wed, 14 Jun 2023 23:01:13 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1686783673; 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=hXfM5b9TWvXuzpOpflvxRdYRSJ4e+LrPPPcJqo+uGpc=; b=gCU4s3SPGvfoNpLHvTSKOTR1U9qc6Z/yheB5Dw3qR6b1mgLvN2Lbf6fg5JiY0SIPOgEwBQ bRnWfaNwzSw8OQaw+GIaPlnvO8lZvjSXmY12R7dM7n4JXvVnu8n2Lr1JSlZmRIzhcbuuv3 Yx8o93nw6M6oOAUwDYNffWyyTv55pFKyBE1eQxmuG297qGxBkjL/v1WoczFLyW9Q11v6eZ 4Adzmv2hJDNnXqLT0DLra5ojWnfq8aiMW9ofNYe9tIpPEGXqMLSKnfs/U9DPv33bVQYL1w Lyw07iBWcSbGrV2o+v9SvohRCa/Y+G65GC1n5hMApFzn7M4O/M9LFPmfx2gr0g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1686783673; 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=hXfM5b9TWvXuzpOpflvxRdYRSJ4e+LrPPPcJqo+uGpc=; b=imtXMDQdbFmMsjaBOITRF59Y+b5JXoMKTd0cbjWOxSadtVLoR3RAPmgotFxYdMNW19WRZm Joxf+IyOg9v3h5ApoboMeU7oFI7I3oEjwEbeKjdYHq8fZuN80t90PfBKtiGGE04B+8Ukmy 94j4gvxA0pf0onSJVVy0v+cLkAA6QTqKdt27+gYwYWhGoUnWrMQPOE0tqNsUVfcsd2/GPd XkE+p8jwAUl8HeagO2k9QxBAuT9zLLFqu2EWa4keMnykJZzcyrl72jEpg1PP8+cZv25XPF jpgFjgbsuJR/LM6nBxl3urJ4cKe5S8wT6KWAdyZU33F3v6gqFsGQQoJd9d9eZw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1686783673; a=rsa-sha256; cv=none; b=FwEn2OJNHA5WYYuxPNJWPvofLdp1Bl/k7EmeZzDDQFs4nmandr3nYYriOjCIqw5iIn50L9 TthpuR6EDyL10vcpIfM9dNsUaGPSL43uAXEu5OwDaoW+ODBrnoJljRpBANQjRg05PfJXaN meupZ6uplGXjA/b8zl+GUj6hEsRMFD94oW4QAvL98lKp9vcOnVI+UAmKi8VodxGF5TPgAZ WynxLyc1tRtqAcyLJ9pKfsVyG2e4Nne0ucJTIPs9TWp6FCuBxjnmbZUazV1atk3PyVeHm8 ulxDdEP4e0hdNMp7r3lhKW9BU1y8mG0YeChF5d1nQ3JZ0nSK9OP3vtyoxvw5oA== 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 4QhLWY08JLzN26; Wed, 14 Jun 2023 23:01:13 +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 35EN1C2X052360; Wed, 14 Jun 2023 23:01:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 35EN1C2l052359; Wed, 14 Jun 2023 23:01:12 GMT (envelope-from git) Date: Wed, 14 Jun 2023 23:01:12 GMT Message-Id: <202306142301.35EN1C2l052359@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Jessica Clarke Subject: git: 456c1199d3b3 - main - resizewin: Stop printing bogus NUL to TTY List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jrtc27 X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 456c1199d3b3ee477463c6469940c0370de2b2ea Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=456c1199d3b3ee477463c6469940c0370de2b2ea commit 456c1199d3b3ee477463c6469940c0370de2b2ea Author: Jessica Clarke AuthorDate: 2023-06-14 22:58:36 +0000 Commit: Jessica Clarke CommitDate: 2023-06-14 22:58:36 +0000 resizewin: Stop printing bogus NUL to TTY A char array has an implicit NUL terminating it, which sizeof will include, so we need to subtract 1 here. Printing a NUL can cause issues for things like CI environments that aren't expecting it, especially with recent Jenkins being stricter about not putting NUL in XML files. Fixes: 3d222369acbe ("Add a small tool, resizewin(1), to query terminal for window size") MFC after: 1 week --- usr.bin/resizewin/resizewin.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.bin/resizewin/resizewin.c b/usr.bin/resizewin/resizewin.c index b6df862b8a49..e53364cf1254 100644 --- a/usr.bin/resizewin/resizewin.c +++ b/usr.bin/resizewin/resizewin.c @@ -101,7 +101,7 @@ main(int argc, char **argv) if (tcsetattr(fd, TCSAFLUSH, &new) == -1) exit(1); - if (write(fd, query, sizeof(query)) != sizeof(query)) { + if (write(fd, query, sizeof(query) - 1) != sizeof(query) - 1) { error = 1; goto out; }