On Thu, Dec 31, 2015 at 01:21:42AM -0500, Eric Sunshine wrote:
> > - item->string[len] = '\0';
> > + len = strlen(item->string);
> > + while (len && item->string[len - 1] == '\n')
> > + item->string[--len] = '\0';
>
> Not a strong objection, but this
On Fri, Jan 01, 2016 at 03:42:06AM -0500, Jeff King wrote:
> On Thu, Dec 31, 2015 at 01:21:42AM -0500, Eric Sunshine wrote:
>
> > > - item->string[len] = '\0';
> > > + len = strlen(item->string);
> > > + while (len && item->string[len - 1] == '\n')
> > > +
On Tue, Dec 29, 2015 at 2:20 AM, Jeff King wrote:
> We want to chomp newlines off the end of the "value" string.
> But because it's const, we must track its length rather than
> writing a NUL. This leads to us having to tweak that length
> later, to account for moving the pointer
We want to chomp newlines off the end of the "value" string.
But because it's const, we must track its length rather than
writing a NUL. This leads to us having to tweak that length
later, to account for moving the pointer forward.
Since we are about to create a copy of it anyway, let's just
wait
4 matches
Mail list logo