summaryrefslogtreecommitdiff
path: root/pkt-line.c
diff options
context:
space:
mode:
authorShawn O. Pearce <spearce@spearce.org>2009-10-31 00:47:22 (GMT)
committerJunio C Hamano <gitster@pobox.com>2009-10-31 02:20:53 (GMT)
commit743c4b7b0fa5422d1bb5dc59c6cb919a881dd98b (patch)
tree8bbf63388df51ae51be534dc4eec0cba6bc27d55 /pkt-line.c
parentf5615d246770a2796e60b06dd5e17f5e79d5dd0c (diff)
downloadgit-743c4b7b0fa5422d1bb5dc59c6cb919a881dd98b.zip
git-743c4b7b0fa5422d1bb5dc59c6cb919a881dd98b.tar.gz
git-743c4b7b0fa5422d1bb5dc59c6cb919a881dd98b.tar.bz2
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 bd603f8..295ba2b 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;