Thread (1 message) 1 message, 1 author, 2017-09-19

Re: [PATCH 1/2] read_info_alternates: read contents into strbuf

From: Junio C Hamano <hidden>
Date: 2017-09-19 00:08:37

Jeff King [off-list ref] writes:
We could also just make a NUL-terminated copy of the input
bytes and operate on that. But since all but one caller
already is passing a string, instead let's just fix that
caller to provide NUL-terminated input in the first place,
by swapping out mmap for strbuf_read_file().
...
Let's also drop the "len" parameter entirely from
link_alt_odb_entries(), since it's completely ignored. That
will avoid any new callers re-introducing a similar bug.
Both design decisions make perfect sense to me.
 sha1_file.c | 29 +++++++++--------------------
 1 file changed, 9 insertions(+), 20 deletions(-)
And diffstat also agrees that it is a good change ;-)
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help