Skip to content

Commit 743c4b7

Browse files
spearcegitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent f5615d2 commit 743c4b7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pkt-line.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ int packet_read_line(int fd, char *buffer, unsigned size)
129129
safe_read(fd, linelen, 4);
130130
len = packet_length(linelen);
131131
if (len < 0)
132-
die("protocol error: bad line length character");
132+
die("protocol error: bad line length character: %.4s", linelen);
133133
if (!len)
134134
return 0;
135135
len -= 4;

0 commit comments

Comments
 (0)