Re: [PATCH 53/67] drop strcpy in favor of raw sha1_to_hex
- From
Jeff King <peff@peff.net>
- Date
- Sep 18, 2015, 19:29 UTC
- Message-ID
- <20150918192928.GF11068@sigill.intra.peff.net>
- In-Reply-To
- <CAPig+cRaPu0_WdLwE_O3UddP5LEvqqB7gOkyg5ne9YkXu_JJ9w@mail.gmail.com>
On Fri, Sep 18, 2015 at 03:24:37PM -0400, Eric Sunshine wrote:
Show 11 quoted lines
> > fprintf(stderr, "updating '%s'", ref->name); > > if (strcmp(ref->name, ref->peer_ref->name)) > > fprintf(stderr, " using '%s'", ref->peer_ref->name); > > - fprintf(stderr, "\n from %s\n to %s\n", old_hex, new_hex); > > + fprintf(stderr, "\n from %s\n to %s\n", > > + sha1_to_hex(ref->old_sha1), sha1_to_hex(ref->new_sha1)); > > Would it make sense for the commit message can mention that when this > code was written originally, it was not safe to call sha1_to_hex() > twice like this within a single expression, but became safe as of > dcb3450 (sha1_to_hex() usage cleanup, 2006-05-03)?
Sure. I suspected that was the case (there were several spots like this in http-push.c), but didn't actually dig.
-Peff