Thread (2 messages) flat view 2 messages, 2 authors, 2017-01-15

Re: [PATCHv3 2/2] builtin/commit.c: switch to xstrfmt(), instead of snprintf,

From: Elia Pinto <hidden>
Date: 2017-01-15 08:13:31

2017-01-15 3:42 GMT+01:00 Junio C Hamano [off-list ref]:
Elia Pinto [off-list ref] writes:
quoted
Ok. I agree. But  is it strictly necessary to resend for this ?
FWIW, the attacched is what I queued locally, after complaining
"both have the same title?  They need to be explained better."

In any case, I sense that 2/2 will be redone using strbuf, from the
looks of what is discussed in a subthread nearby?
Yes, it seems to me correct, I resend the patch 2/2 based on the review

thank you all
Thanks.

commit 8d7aa4ba6a00b3ff69261e88b4842c0df5662125
Author: Elia Pinto [off-list ref]
Date:   Fri Jan 13 17:58:00 2017 +0000

    builtin/commit.c: remove the PATH_MAX limitation via dynamic allocation

    Remove the PATH_MAX limitation from the environment setting that
    points to a filename by switching to dynamic allocation.

    As a side effect of this change, we also reduce the snprintf()
    calls, that may silently truncate results if the programmer is not
    careful.

    Helped-by: Junio C Hamano [off-list ref]
    Helped-by: Jeff King [off-list ref]
    Signed-off-by: Elia Pinto [off-list ref]
    Signed-off-by: Junio C Hamano [off-list ref]

commit 2a7e328877982557d921a398af9442093290c613
Author: Elia Pinto [off-list ref]
Date:   Fri Jan 13 17:58:01 2017 +0000

    builtin/commit.c: switch to xstrfmt(), instead of snprintf()

    Switch to dynamic allocation with xstrfmt(), so we can avoid dealing
    with magic numbers in the code and reduce the cognitive burden from
    the programmers.  The original code is correct, but programmers no
    longer have to count bytes needed for static allocation to know that.

    As a side effect of this change, we also reduce the snprintf()
    calls, that may silently truncate results if the programmer is not
    careful.

    Helped-by: Junio C Hamano [off-list ref]
    Helped-by: Jeff King [off-list ref]
    Signed-off-by: Elia Pinto [off-list ref]
    Signed-off-by: Junio C Hamano [off-list ref]
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help