From: Junio C Hamano <gitster@pobox.com>
To: Eric Sunshine <sunshine@sunshineco.com>
Cc: "Carlo Marcelo Arenas Belón" <carenas@gmail.com>,
"Git List" <git@vger.kernel.org>,
nickh@reactrix.com
Subject: Re: [PATCH] http-push: workaround for format overflow warning in gcc >= 9
Date: Mon, 13 May 2019 14:57:46 +0900 [thread overview]
Message-ID: <xmqqa7fqdhgl.fsf@gitster-ct.c.googlers.com> (raw)
In-Reply-To: <CAPig+cSY4SKXcppM6UYpeJ3z+PrUwiJ=whCmHQv4e_3CUZSwoQ@mail.gmail.com> (Eric Sunshine's message of "Fri, 10 May 2019 03:50:32 -0400")
Eric Sunshine <sunshine@sunshineco.com> writes:
>> if (request->curl_result != CURLE_OK) {
>> fprintf(stderr, "Unable to get pack file %s\n%s",
>> - request->url, curl_errorstr);
>> + request->url ? request->url : "",
>> + curl_errorstr);
>> } else {
>
> If I'm reading the code correctly, the conditional and "true" branch
> of the ternary expression are dead code since 'request->url' will
> unconditionally be NULL due to the:
>
> /* URL is reused for MOVE after PUT */
> if (request->state != RUN_PUT) {
> FREE_AND_NULL(request->url);
> }
>
> earlier in the function. If you want to present a meaningful error
> message here, I could imagine squirreling-away the URL so it can be
> used in the error message, or re-working the code so that
> FREE_AND_NULL(request->url) is only done when and if needed.
That matches my understanding.
prev parent reply other threads:[~2019-05-13 5:57 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-05-10 6:58 [PATCH] http-push: workaround for format overflow warning in gcc >= 9 Carlo Marcelo Arenas Belón
2019-05-10 7:50 ` Eric Sunshine
2019-05-13 5:57 ` Junio C Hamano [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=xmqqa7fqdhgl.fsf@gitster-ct.c.googlers.com \
--to=gitster@pobox.com \
--cc=carenas@gmail.com \
--cc=git@vger.kernel.org \
--cc=nickh@reactrix.com \
--cc=sunshine@sunshineco.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).