Re: [PATCHv2 04/10] pkt-line: change error message for oversized packet
- From
Jeff King <peff@peff.net>
- Date
- Feb 18, 2013, 10:26 UTC
- Message-ID
- <20130218102628.GO5096@sigill.intra.peff.net>
- In-Reply-To
- <20130218101523.GD7049@elie.Belkin>
On Mon, Feb 18, 2013 at 02:15:23AM -0800, Jonathan Nieder wrote:
Show 14 quoted lines
> Jeff King wrote:
>
> > --- a/pkt-line.c
> > +++ b/pkt-line.c
> > @@ -160,7 +160,8 @@ static int packet_read_internal(int fd, char *buffer, unsigned size, int gently)
> > }
> > len -= 4;
> > if (len >= size)
> > - die("protocol error: bad line length %d", len);
> > + die("protocol error: line too large: (expected %u, got %d)",
> > + size, len);
>
> Makes sense. I think this should say "expected < %u, got %d", since we
> don't actually expect most lines to be 1004 bytes in practice.Yeah, I had toyed with writing "expected max %u" for the same reason. I'll tweak it in the re-roll.
-Peff