Radish alpha
H
HardenedBSD Package Manager
Radicle
Git (anonymous pull)
Log in to clone via SSH
Do not divide by zero!
jlaffaye committed 15 years ago
commit e2fa4f71cdfb7972911f0ea78cafb0d8d0484e90
parent e2333623a15870be94e484990eb6324ee3e6df86
2 files changed +1 -3
modified libpkg/pkg_repo.c
@@ -12,8 +12,6 @@
#include "pkg_private.h"
#include "pkg_util.h"

-
/* TODO: error reporting #@! */
-

int
pkg_create_repo(char *path, void (progress)(struct pkg *pkg, void *data), void *data)
{
modified libpkg/pkgdb.c
@@ -1250,7 +1250,7 @@ pkgdb_compact(struct pkgdb *db)
	if (ret != EPKG_OK)
		return (EPKG_FATAL);

-
	if (page_count / freelist_count < 0.25)
+
	if (freelist_count == 0 || page_count / freelist_count < 0.25)
		return (EPKG_OK);

	if (sqlite3_exec(db->sqlite, "VACUUM;", NULL, NULL, &errmsg) != SQLITE_OK){