From beb148658ea025d09a4b9a256064bcb3b131a1cf Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Wed, 9 Jan 2019 10:09:02 +0100 Subject: extra/conky: add hot-fix --- extra/conky/fix-type-mismatch.patch | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 extra/conky/fix-type-mismatch.patch (limited to 'extra/conky/fix-type-mismatch.patch') diff --git a/extra/conky/fix-type-mismatch.patch b/extra/conky/fix-type-mismatch.patch new file mode 100644 index 00000000..286fa107 --- /dev/null +++ b/extra/conky/fix-type-mismatch.patch @@ -0,0 +1,26 @@ +diff --git a/src/linux.cc b/src/linux.cc +index affa1de1..67d4662e 100644 +--- a/src/linux.cc ++++ b/src/linux.cc +@@ -1171,7 +1171,7 @@ static int open_sysfs_sensor(const char *dir, const char *dev, const char *type, + fd = open(path, O_RDONLY); + if (fd < 0) { + /* if it fails, strip the /device from dev and attempt again */ +- buf[std::max(0UL, strnlen(buf, 255) - 7)] = 0; ++ buf[std::max((size_t)0UL, strnlen(buf, 255) - 7)] = 0; + snprintf(path, 255, "%s%s/%s%d_input", dir, dev, type, n); + fd = open(path, O_RDONLY); + if (fd < 0) { +diff --git a/src/mail.cc b/src/mail.cc +index 19dd1af8..fbcc4e2a 100644 +--- a/src/mail.cc ++++ b/src/mail.cc +@@ -302,7 +302,7 @@ static void update_mail_count(struct local_mail_s *mail) { + } + closedir(dir); + +- dirname[std::max(0UL, strnlen(dirname, dirname_len - 1) - 3)] = '\0'; ++ dirname[std::max((size_t)0UL, strnlen(dirname, dirname_len - 1) - 3)] = '\0'; + strcat(dirname, "new"); + + dir = opendir(dirname); -- cgit v1.2.3-70-g09d2 From 3c0c4e6086d03561e3e5baed215a55667ef3805b Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Wed, 9 Jan 2019 10:28:58 +0100 Subject: extra/conky: fix the patch --- extra/conky/PKGBUILD | 2 +- extra/conky/fix-type-mismatch.patch | 23 +++++------------------ 2 files changed, 6 insertions(+), 19 deletions(-) (limited to 'extra/conky/fix-type-mismatch.patch') diff --git a/extra/conky/PKGBUILD b/extra/conky/PKGBUILD index 9e60bb86..506fad26 100644 --- a/extra/conky/PKGBUILD +++ b/extra/conky/PKGBUILD @@ -1,5 +1,5 @@ #see https://github.com/brndnmtthws/conky/issues/759 -sha256sums+=('200df4d59c2c8158298fdf26c9ebaa112036a3f2da09a9b6f9f4336f8b78660c') +sha256sums+=('842a3377b1d4fcaff8ec409b68fe6b05a9faf500f29b4d8e21cec3b4cd5b7da2') source+=('fix-type-mismatch.patch') prepare() { diff --git a/extra/conky/fix-type-mismatch.patch b/extra/conky/fix-type-mismatch.patch index 286fa107..a84d05e2 100644 --- a/extra/conky/fix-type-mismatch.patch +++ b/extra/conky/fix-type-mismatch.patch @@ -1,26 +1,13 @@ diff --git a/src/linux.cc b/src/linux.cc -index affa1de1..67d4662e 100644 +index 0a7d4331..09fa6c99 100644 --- a/src/linux.cc +++ b/src/linux.cc -@@ -1171,7 +1171,7 @@ static int open_sysfs_sensor(const char *dir, const char *dev, const char *type, +@@ -1169,7 +1169,7 @@ static int open_sysfs_sensor(const char *dir, const char *dev, const char *type, fd = open(path, O_RDONLY); if (fd < 0) { /* if it fails, strip the /device from dev and attempt again */ -- buf[std::max(0UL, strnlen(buf, 255) - 7)] = 0; -+ buf[std::max((size_t)0UL, strnlen(buf, 255) - 7)] = 0; +- size_t len_to_trunc = std::max(7UL, strnlen(buf, 255)) - 7; ++ size_t len_to_trunc = std::max((size_t)7UL, strnlen(buf, 255)) - 7; + buf[len_to_trunc] = 0; snprintf(path, 255, "%s%s/%s%d_input", dir, dev, type, n); fd = open(path, O_RDONLY); - if (fd < 0) { -diff --git a/src/mail.cc b/src/mail.cc -index 19dd1af8..fbcc4e2a 100644 ---- a/src/mail.cc -+++ b/src/mail.cc -@@ -302,7 +302,7 @@ static void update_mail_count(struct local_mail_s *mail) { - } - closedir(dir); - -- dirname[std::max(0UL, strnlen(dirname, dirname_len - 1) - 3)] = '\0'; -+ dirname[std::max((size_t)0UL, strnlen(dirname, dirname_len - 1) - 3)] = '\0'; - strcat(dirname, "new"); - - dir = opendir(dirname); -- cgit v1.2.3-70-g09d2