Re: [PATCH 3/7] grep: typesafe versions of grep_source_init
- From
Matheus Tavares Bernardino <matheus.bernardino@usp.br>
- Date
- Aug 11, 2021, 22:45 UTC
- Message-ID
- <CAHd-oW4tLJf1VxWDOkzKtJCV9X_rqfWPg_yOONYo7S8O1kCjGQ@mail.gmail.com>
- In-Reply-To
- <e5e6a0dc1ef59b2ab419816e463814d93115e7f6.1628618950.git.jonathantanmy@google.com>
On Tue, Aug 10, 2021 at 3:29 PM Jonathan Tan <jonathantanmy@google.com> wrote:
Show 13 quoted lines
> > diff --git a/grep.c b/grep.c > index 424a39591b..ba3711dc56 100644 > --- a/grep.c > +++ b/grep.c > @@ -1830,7 +1830,7 @@ int grep_buffer(struct grep_opt *opt, char *buf, unsigned long size) > struct grep_source gs; > int r; > > - grep_source_init(&gs, GREP_SOURCE_BUF, NULL, NULL, NULL); > + grep_source_init_buf(&gs); > gs.buf = buf; > gs.size = size;
Small nit: perhaps `grep_source_init_buf()` could take `buf` and `size` too, so that all the fields get initialized by the same function.