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
f87c5f7f43
commit
408242edcf
1 changed files with 2 additions and 2 deletions
|
@ -58,8 +58,8 @@ readpkt(Conn *c, char *buf, int nbuf)
|
||||||
char *e;
|
char *e;
|
||||||
int n;
|
int n;
|
||||||
|
|
||||||
if(readn(c->rfd, len, 4) == -1)
|
if(readn(c->rfd, len, 4) != 4)
|
||||||
return -1;
|
sysfatal("pktline: short read from transport");
|
||||||
len[4] = 0;
|
len[4] = 0;
|
||||||
n = strtol(len, &e, 16);
|
n = strtol(len, &e, 16);
|
||||||
if(n == 0){
|
if(n == 0){
|
||||||
|
|
Loading…
Reference in a new issue