Skip to content

Commit d8d284d

Browse files
committed
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.
1 parent 9318627 commit d8d284d

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

lib/fetch/common.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1490,10 +1490,10 @@ fetch_read(conn_t *conn, char *buf, size_t len)
14901490
ssize_t rlen;
14911491
int r;
14921492

1493-
if (!buf)
1494-
return -1;
14951493
if (len == 0)
14961494
return 0;
1495+
if (!buf)
1496+
return -1;
14971497

14981498
if (conn->next_len != 0) {
14991499
if (conn->next_len < len)

0 commit comments

Comments
 (0)