Skip to content

Commit

Permalink
pkt-line: Make packet_read_line easier to debug
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
spearce authored and gitster committed Oct 31, 2009
1 parent f5615d2 commit 743c4b7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkt-line.c
Expand Up @@ -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;
Expand Down

0 comments on commit 743c4b7

Please sign in to comment.