Re: [PATCH 04/15] logmsg_reencode: return const buffer

2014-06-09 Thread Eric Sunshine
On Mon, Jun 9, 2014 at 2:10 PM, Jeff King wrote: > The return value from logmsg_reencode may be either a newly > allocated buffer or a pointer to the existing commit->buffer. > We would not want the caller to accidentally free() or > modify the latter, so let's mark it as const. We can cast > awa

[PATCH 04/15] logmsg_reencode: return const buffer

2014-06-09 Thread Jeff King
The return value from logmsg_reencode may be either a newly allocated buffer or a pointer to the existing commit->buffer. We would not want the caller to accidentally free() or modify the latter, so let's mark it as const. We can cast away the constness in logmsg_free, but only once we have determ