Radish alpha
H
rad:z3QDZAW2FAfuLvihrhiyDC9fAD8G9
HardenedBSD Package Manager
Radicle
Git
directly use the new variable to compare with sizeof
Baptiste Daroussin committed 13 years ago
commit 5953df2d5a54be3aa34cf8da9de3d0a8ec73c3dd
parent c42ca2c
1 file changed +1 -1
modified libpkg/fetch.c
@@ -336,7 +336,7 @@ pkg_fetch_file_to_fd(struct pkg_fetch *f, const char *url, int dest, time_t *t)
		} else {
			kevent(kq, &e, 1, &ev, 1, NULL);
			size_t size = (size_t)ev.data;
-
			if ((size_t)ev.data > sizeof(buf))
+
			if (size > sizeof(buf))
				size = sizeof(buf);
			if ((r = fread(buf, 1, size, remote)) < 1)
				break;