From 743c4b7b0fa5422d1bb5dc59c6cb919a881dd98b Mon Sep 17 00:00:00 2001 From: "Shawn O. Pearce" Date: Fri, 30 Oct 2009 17:47:22 -0700 Subject: [PATCH] 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 --- pkt-line.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; -- 2.30.2