summaryrefslogtreecommitdiff
path: root/pkt-line.c
diff options
context:
space:
mode:
authorLibravatar Shawn O. Pearce <spearce@spearce.org>2009-10-30 17:47:22 -0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2009-10-30 19:20:53 -0700
commit743c4b7b0fa5422d1bb5dc59c6cb919a881dd98b (patch)
tree8bbf63388df51ae51be534dc4eec0cba6bc27d55 /pkt-line.c
parentpkt-line: Add strbuf based functions (diff)
downloadtgif-743c4b7b0fa5422d1bb5dc59c6cb919a881dd98b.tar.xz
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 <spearce@spearce.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'pkt-line.c')
-rw-r--r--pkt-line.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/pkt-line.c b/pkt-line.c
index bd603f8721..295ba2b16c 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;