From 989997d1488ad22b1aabe0ae34324d56b4f72fc7 Mon Sep 17 00:00:00 2001
From: graham.gower@gmail.com <graham.gower@gmail.com@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358>
Date: Sun, 11 Sep 2011 21:24:24 -0400
Subject: Don't use conf->offline_root directly, it might be NULL.

This patch fixes a problem that arises when conf->offline_root is
null. The resulting string was "(null)//etc/opkg/trusted.gpg" when it
should have been "/etc/opkg/trusted.gpg".

From Kyle Manna <kyle.manna@gmail.com>.

git-svn-id: http://opkg.googlecode.com/svn/trunk@626 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
---
(limited to 'libopkg')

diff --git a/libopkg/opkg_download.c b/libopkg/opkg_download.c
index 4a8b2a2..e53e64e 100644
--- a/libopkg/opkg_download.c
+++ b/libopkg/opkg_download.c
@@ -360,7 +360,7 @@ opkg_verify_file (char *text_file, char *sig_file)
     if (err)
 	return -1;
 
-    sprintf_alloc(&trusted_path, "%s/%s", conf->offline_root, "/etc/opkg/trusted.gpg");
+    trusted_path = root_filename_alloc("/etc/opkg/trusted.gpg");
     err = gpgme_data_new_from_file (&key, trusted_path, 1);
     free (trusted_path);
     if (err)
--
cgit v0.9.1