diff options
author | morganamilo <morganamilo@archlinux.org> | 2020-11-24 13:39:07 +0100 |
---|---|---|
committer | Allan McRae <allan@archlinux.org> | 2020-11-26 12:08:13 +0100 |
commit | 66f9f315cf36a5b73c18c627f7cee060a1360abd (patch) | |
tree | 650162b02c8f27d254fd5281976a7588fc2e98de /lib/libalpm | |
parent | 75cfce94682fcd0e9bbeed5db1f97dbb5b1be9e7 (diff) | |
download | pacman-66f9f315cf36a5b73c18c627f7cee060a1360abd.tar.gz pacman-66f9f315cf36a5b73c18c627f7cee060a1360abd.tar.xz |
libalpm: set errno when setting parallel downloads with an invalid number
Signed-off-by: Allan McRae <allan@archlinux.org>
Diffstat (limited to 'lib/libalpm')
-rw-r--r-- | lib/libalpm/handle.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/lib/libalpm/handle.c b/lib/libalpm/handle.c index 1310601a..16d4beaa 100644 --- a/lib/libalpm/handle.c +++ b/lib/libalpm/handle.c @@ -857,9 +857,7 @@ int SYMEXPORT alpm_option_set_parallel_downloads(alpm_handle_t *handle, { CHECK_HANDLE(handle, return -1); #ifdef HAVE_LIBCURL - if(num_streams < 1) { - return -1; - } + ASSERT(num_streams >= 1, RET_ERR(handle, ALPM_ERR_WRONG_ARGS, -1)); handle->parallel_downloads = num_streams; #else (void)num_streams; /* silence unused variable warnings */ |