From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#56048: [PATCH] bindat (strz): Null terminate fixed-length strings if there is room Date: Sat, 18 Jun 2022 09:32:51 +0300 Message-ID: <83r13mo50s.fsf@gnu.org> References: <8b471c36-abbe-819c-96d8-8f0d7b671afb@rhansen.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="9517"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 56048@debbugs.gnu.org, monnier@iro.umontreal.ca To: Richard Hansen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Jun 18 08:34:14 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1o2S2A-0002Go-Af for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 18 Jun 2022 08:34:14 +0200 Original-Received: from localhost ([::1]:53688 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o2S28-0006Me-Oa for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 18 Jun 2022 02:34:12 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:52592) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o2S1y-0006Kq-T6 for bug-gnu-emacs@gnu.org; Sat, 18 Jun 2022 02:34:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:53516) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1o2S1y-0000zP-Jk for bug-gnu-emacs@gnu.org; Sat, 18 Jun 2022 02:34:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1o2S1y-0000Ht-G4 for bug-gnu-emacs@gnu.org; Sat, 18 Jun 2022 02:34:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 18 Jun 2022 06:34:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 56048 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 56048-submit@debbugs.gnu.org id=B56048.16555339821035 (code B ref 56048); Sat, 18 Jun 2022 06:34:02 +0000 Original-Received: (at 56048) by debbugs.gnu.org; 18 Jun 2022 06:33:02 +0000 Original-Received: from localhost ([127.0.0.1]:47413 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o2S10-0000GV-93 for submit@debbugs.gnu.org; Sat, 18 Jun 2022 02:33:02 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:39330) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o2S0y-0000G9-38 for 56048@debbugs.gnu.org; Sat, 18 Jun 2022 02:33:01 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:58792) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o2S0s-0000Y8-6A; Sat, 18 Jun 2022 02:32:54 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=/U/716SW2BVaXW8Ezch/FdeYBdhesKvOaP0KYVkWURU=; b=o5wenmAAi2n+ UIElHDf2hqJOZz2ZXmvSIVpHz90rhVCSKr1UdtvdtFnxYkm/wudWBPs+j4zfAbJlAA2m7TmWGqA9v 38ZZ5E9qKEDAzwIWsL2ZZiXxhR9rhB7rYcBdENP06LlJv4TkQMUDWNaQ1XMOkE0Si9GvUZlgWEmWo cd/Hc8o8hm+432V14yXjfZfOt99BkRsjS/zzRrJPOnqIe8uZ63/sHwcQG7ubjFH7P45cTgc3+BZF9 QD0+7ncfgkpDmoLXO93HZmP4WQaOZg4tJoByLKcGcu2M5JFyUKfYUNdwQvD1vPxNarUhQd379vmyu NeYO4PQVXFmcFViH4z4ayw==; Original-Received: from [87.69.77.57] (port=4694 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o2S0r-0003bG-Lc; Sat, 18 Jun 2022 02:32:53 -0400 In-Reply-To: (message from Richard Hansen on Fri, 17 Jun 2022 23:02:57 -0400) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:234737 Archived-At: > Cc: monnier@iro.umontreal.ca > Date: Fri, 17 Jun 2022 23:02:57 -0400 > From: Richard Hansen > > Attached are new revisions of the patches. The only differences are the comments were filled at column 70 instead of 80, and the commit message mentions the bug number. While waiting for Stefan to tell whether he has any comments, a couple of nits: > Subject: [PATCH v2 1/2] ; bindat (strz): Move all pack logic to pack function What is the motivation/rationale for this refactoring? > +When packing, a null terminator is written after the packed string if > +the length of the input string is less than @var{len}. Since "length of a string" is highly ambiguous in Emacs, please always make a point of saying "@var{len} bytes" explicitly. Byte length is something rarely seen or used in Emacs, so people must be informed about that each time. Thanks.