GNU bug report logs -
#56048
[PATCH] bindat (strz): Null terminate fixed-length strings if there is room
Previous Next
Reported by: Richard Hansen <rhansen <at> rhansen.org>
Date: Fri, 17 Jun 2022 22:54:02 UTC
Severity: wishlist
Tags: patch
Done: Eli Zaretskii <eliz <at> gnu.org>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
[Message part 1 (text/plain, inline)]
On 2022-06-18 02:32, Eli Zaretskii wrote:
>> Subject: [PATCH v2 1/2] ; bindat (strz): Move all pack logic to pack function
>
> What is the motivation/rationale for this refactoring?
The attached revision updates the commit message to explain:
; bindat (strz): Move all pack logic to pack function
Motivation/rationale:
* Improve code readability. Now `bindat--pack-strz` is used for all
`strz` packing, not just variable-length `strz` packing.
* Make it easier to change the behavior of fixed-length `strz`
packing without also affecting the behavior of `str` packing. (A
future commit will modify `strz` to write a null terminator if
there is room.)
>
>> +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.
Done; see attached revision.
Thanks,
Richard
[v3-0001-bindat-strz-Move-all-pack-logic-to-pack-function.patch (text/x-patch, attachment)]
[v3-0002-bindat-strz-Null-terminate-fixed-length-strings-i.patch (text/x-patch, attachment)]
[OpenPGP_signature (application/pgp-signature, attachment)]
This bug report was last modified 3 years and 21 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.