Re: [PATCH] Use split_ident_line() in parse_user()

2014-12-23 Thread Lukas Fleischer
On Wed, 24 Dec 2014 at 02:57:45, Jason A. Donenfeld wrote:
> On Wed, Dec 17, 2014 at 5:19 AM, Lukas Fleischer 
> wrote:
> 
> > Use Git's built-in ident line splitting algorithm instead of
> > reimplementing it. This does not only simplify the code but also makes
> > sure that cgit is consistent with Git when it comes to author parsing.
> >
> 
> Thank heavens!
> 
> > +   email_len = ident.mail_end - ident.mail_begin;
> > +   *email = xmalloc(strlen("<") + email_len + strlen(">\0"));
> > +   sprintf(*email, "<%.*s>", email_len, ident.mail_begin);
> > +
> >
> 
> strlen(">\0") -- isn't the null superfluous? Cleanup and resubmit?

I think this is even wrong because it means the buffer won't be large
enough to hold the terminating null character. Will resubmit.
___
CGit mailing list
CGit@lists.zx2c4.com
http://lists.zx2c4.com/mailman/listinfo/cgit


Re: [PATCH] Use split_ident_line() in parse_user()

2014-12-23 Thread Jason A. Donenfeld
On Wed, Dec 17, 2014 at 5:19 AM, Lukas Fleischer 
wrote:

> Use Git's built-in ident line splitting algorithm instead of
> reimplementing it. This does not only simplify the code but also makes
> sure that cgit is consistent with Git when it comes to author parsing.
>

Thank heavens!

> +   email_len = ident.mail_end - ident.mail_begin;
> +   *email = xmalloc(strlen("<") + email_len + strlen(">\0"));
> +   sprintf(*email, "<%.*s>", email_len, ident.mail_begin);
> +
>

strlen(">\0") -- isn't the null superfluous? Cleanup and resubmit?
___
CGit mailing list
CGit@lists.zx2c4.com
http://lists.zx2c4.com/mailman/listinfo/cgit