git: improve error on short read
we don't recover from an invalid packet, so just sysfatal with a useful message.
This commit is contained in:
parent
8fbfba1ecf
commit
9a1428f41a
1 changed files with 2 additions and 2 deletions
|
@ -58,8 +58,8 @@ readpkt(Conn *c, char *buf, int nbuf)
|
|||
char *e;
|
||||
int n;
|
||||
|
||||
if(readn(c->rfd, len, 4) == -1)
|
||||
return -1;
|
||||
if(readn(c->rfd, len, 4) != 4)
|
||||
sysfatal("pktline: short read from transport");
|
||||
len[4] = 0;
|
||||
n = strtol(len, &e, 16);
|
||||
if(n == 0){
|
||||
|
|
Loading…
Reference in a new issue