Andrew's git
/
gitweb.git
/ blobdiff
summary
|
log
|
commit
|
diff
|
tree
commit
grep
author
committer
pickaxe
?
re
pkt-line: fix packet_read_line() to handle len < 0 errors
[gitweb.git]
/
pkt-line.c
diff --git
a/pkt-line.c
b/pkt-line.c
index d4b6bfe076341d64bb948e4932655b927a369bc0..6f05b1a4a8bea31686f50ea906987a701148f166 100644
(file)
--- a/
pkt-line.c
+++ b/
pkt-line.c
@@
-315,7
+315,7
@@
static char *packet_read_line_generic(int fd,
PACKET_READ_CHOMP_NEWLINE);
if (dst_len)
*dst_len = len;
- return
len
? packet_buffer : NULL;
+ return
(len > 0)
? packet_buffer : NULL;
}
char *packet_read_line(int fd, int *len_p)