summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRosen Penev2019-11-29 21:08:32 +0000
committerPetr Štetiar2020-01-21 07:32:48 +0000
commit80d161eb5b95ceb51db989196405eaa00950e03b (patch)
treecaeab8f4e28247d6ccdd307e519f87517a038bd5
parentdcbc142e51f5f5f2fb9e4e44657e013d3c36a52b (diff)
downloadopkg-lede-80d161eb5b95ceb51db989196405eaa00950e03b.tar.gz
opkg: Fix -Wformat-overflow warning
A null pointer is being passed to printf. This can lead to problems. Fixes warning: error: '%s' directive argument is null [-Werror=format-overflow=] 41 | opkg_message(l, "%s: "fmt, __FUNCTION__, ##args); \ | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ note: in expansion of macro 'opkg_msg' 45 | opkg_msg(l, fmt": %s.\n", ##args, strerror(errno)) | ^~~~~~~~ note: in expansion of macro 'opkg_perror' 247 | opkg_perror(ERROR, "Failed to create temporary directory '%s'", Signed-off-by: Rosen Penev <rosenp@gmail.com>
-rw-r--r--libopkg/opkg_install.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/libopkg/opkg_install.c b/libopkg/opkg_install.c
index 976f446..27c9484 100644
--- a/libopkg/opkg_install.c
+++ b/libopkg/opkg_install.c
@@ -244,8 +244,7 @@ static int unpack_pkg_control_files(pkg_t * pkg)
tmp_unpack_dir = mkdtemp(tmp_unpack_dir);
if (tmp_unpack_dir == NULL) {
- opkg_perror(ERROR, "Failed to create temporary directory '%s'",
- tmp_unpack_dir);
+ opkg_perror(ERROR, "Failed to create temporary directory");
return -1;
}