From: Shawn O. Pearce Date: Sat, 31 Oct 2009 00:47:22 +0000 (-0700) Subject: pkt-line: Make packet_read_line easier to debug X-Git-Tag: v1.6.6-rc0~22^2~34 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=743c4b7b0fa5422d1bb5dc59c6cb919a881dd98b;p=git.git pkt-line: Make packet_read_line easier to debug When there is an error parsing the 4 byte length component we now display it as part of the die message, this may hint as to what data was misunderstood by the application. Signed-off-by: Shawn O. Pearce Signed-off-by: Junio C Hamano --- diff --git a/pkt-line.c b/pkt-line.c index bd603f872..295ba2b16 100644 --- a/pkt-line.c +++ b/pkt-line.c @@ -129,7 +129,7 @@ int packet_read_line(int fd, char *buffer, unsigned size) safe_read(fd, linelen, 4); len = packet_length(linelen); if (len < 0) - die("protocol error: bad line length character"); + die("protocol error: bad line length character: %.4s", linelen); if (!len) return 0; len -= 4;