lib/fetch: return 0 if buffer len is 0 and buf is NULL
Previously it would return -1 when xbps would download an empty files.
This commit is contained in:
parent
93186276ee
commit
d8d284d7c8
@ -1490,10 +1490,10 @@ fetch_read(conn_t *conn, char *buf, size_t len)
|
||||
ssize_t rlen;
|
||||
int r;
|
||||
|
||||
if (!buf)
|
||||
return -1;
|
||||
if (len == 0)
|
||||
return 0;
|
||||
if (!buf)
|
||||
return -1;
|
||||
|
||||
if (conn->next_len != 0) {
|
||||
if (conn->next_len < len)
|
||||
|
Loading…
Reference in New Issue
Block a user