Radish alpha
H
HardenedBSD Package Manager
Radicle
Git (anonymous pull)
Log in to clone via SSH
Dont store value to buffer_len if never read.
jlaffaye committed 15 years ago
commit bf90583c4fd8292c6d1a4de59ba4ccc48d610142
parent 4cb8c3971756005d902ff697734492227e5c0855
1 file changed +3 -3
modified libpkg/pkg_compat.c
@@ -239,7 +239,7 @@ pkg_compat_convert_installed(const char *pkg_dbdir, char *pkgname, char *mpath)

	snprintf(filepath, sizeof(filepath), "%s/%s/+CONTENTS", pkg_dbdir, pkgname);

-
	if ((buffer_len = file_to_buffer(filepath, &buffer)) == -1) {
+
	if (file_to_buffer(filepath, &buffer) == -1) {
		warnx("can not read %s", filepath);
		return (NULL);
	}
@@ -268,7 +268,7 @@ pkg_compat_convert_installed(const char *pkg_dbdir, char *pkgname, char *mpath)
	/* adding description */
	snprintf(filepath, sizeof(filepath), "%s/+DESC", dirname(filepath));

-
	if ((buffer_len = file_to_buffer(filepath, &buffer)) == -1) {
+
	if (file_to_buffer(filepath, &buffer) == -1) {
		warn("Unable to read +DESC for %s", pkgname);
	} else {
		pkg_manifest_add_value(m, "desc", buffer);
@@ -278,7 +278,7 @@ pkg_compat_convert_installed(const char *pkg_dbdir, char *pkgname, char *mpath)
	/* adding display */
	snprintf(filepath, sizeof(filepath), "%s/+DISPLAY", dirname(filepath));
	/* ignore if no +DISPLAY */
-
	if ((buffer_len = file_to_buffer(filepath, &buffer)) != -1) {
+
	if (file_to_buffer(filepath, &buffer) != -1) {
		pkg_manifest_add_value(m, "display", buffer);
		free(buffer);
	}