On Wed, 18 Jul 2018 19:07:21 +0200, Ingo Schwarze wrote:
> I think it's more elegant to just break; when getline() returns -1,
> you already have the free() at the end:
>
> if ((len = getline(, , F->fp)) == -1)
> break;
>
> But you get to choose the colour of the bikeshed, OK
Hi Todd,
Todd C. Miller wrote on Tue, Jul 17, 2018 at 01:38:14PM -0600:
> On Tue, 17 Jul 2018 13:21:31 -0600, "Todd C. Miller" wrote:
>> It probably makes more sense to do the newline check (and decrement
>> len if one is present) before newsize is computed. Then you would
>> need to
On Tue, Jul 17 2018 13:38:14 -0600, Todd C. Miller wrote:
> On Tue, 17 Jul 2018 13:21:31 -0600, "Todd C. Miller" wrote:
>
> > It probably makes more sense to do the newline check (and decrement
> > len if one is present) before newsize is computed. Then you would
> > need to unconditionally
On Tue, Jul 17 2018 13:21:31 -0600, Todd C. Miller wrote:
> > @@ -360,17 +364,15 @@ slurpit(INPUT *F)
> > lp->linealloc = newsize;
> > }
> > F->setusedc++;
> > - memmove(lp->line, bp, len);
> > + memmove(lp->line, line, len);
> >
On Tue, 17 Jul 2018 13:21:31 -0600, "Todd C. Miller" wrote:
> It probably makes more sense to do the newline check (and decrement
> len if one is present) before newsize is computed. Then you would
> need to unconditionally NUL-terminate lp->line.
Perhaps something like this.
- todd
Index:
On Tue, 17 Jul 2018 19:39:16 +0300, Lauri Tirkkonen wrote:
> while porting join(1) to Unleashed OS (which does not have fgetln(3)) I
> came up with the following. Since the fgetln man page advises against
> using it, I thought OpenBSD might want this diff too.
Looks good. One minor comment
Hi,
while porting join(1) to Unleashed OS (which does not have fgetln(3)) I
came up with the following. Since the fgetln man page advises against
using it, I thought OpenBSD might want this diff too.
diff --git a/usr.bin/join/join.c b/usr.bin/join/join.c
index 3049a423196..ac62cf83cd1 100644
---