Re: [PATCH] builtin-tag.c: remove global variable to use the callback data of git-config.
- From
- Carlos Rica <jasampler@gmail.com>
- Date
- Mar 16, 2009, 11:46 UTC
- Message-ID
- <1b46aba20903160446y34bf106ai100b8231a54699ab@mail.gmail.com>
- In-Reply-To
- <7vprgjakpz.fsf@gitster.siamese.dyndns.org>
On Sat, Mar 14, 2009 at 9:54 PM, Junio C Hamano <gitster@pobox.com> wrote:
Show 9 quoted lines
> Carlos Rica <jasampler@gmail.com> writes: > >> Signed-off-by: Carlos Rica <jasampler@gmail.com> >> --- >> >> Here I declare a struct to wrap the new local array along with its size. >> QUESTION: An alternative to this is strbuf, would it be preferable? > > The command already uses strbuf for other purposes, so why not?
strbuf is designed as an unlimited length buffer, and now the user signing-key id (obtained from the config or as a command's argument) is limited to the current static array size.
It is right to remove this limit? I haven't found something like strlcpy for strbuf and I'm not sure if it would be a nice adition:
size_t strbuf_lcpy(struct strbuf *dest,
const char *src, size_t max);