summaryrefslogtreecommitdiff
path: root/nodogsplash
diff options
context:
space:
mode:
authorMoritz Warning <moritzwarning@web.de>2019-03-14 18:23:32 +0100
committerGitHub <noreply@github.com>2019-03-14 18:23:32 +0100
commit1cca73b59f13cac7b13d4319374c7f671c51e0c3 (patch)
treefa1f332550897bd04a9c9ad155e5770840f1cf3c /nodogsplash
parenta952ac8c8894236c57d814f4f1e8d53f45ca4662 (diff)
nodogsplash: fix invalid pointer bug when clock is turned back (#456)
Signed-off-by: Moritz Warning <moritzwarning@web.de>
Diffstat (limited to 'nodogsplash')
-rw-r--r--nodogsplash/Makefile2
-rw-r--r--nodogsplash/patches/0001-fix-invalid-pointer-when-clock-is-turned-back.patch51
2 files changed, 52 insertions, 1 deletions
diff --git a/nodogsplash/Makefile b/nodogsplash/Makefile
index 95d5a25..5b09dec 100644
--- a/nodogsplash/Makefile
+++ b/nodogsplash/Makefile
@@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=nodogsplash
PKG_FIXUP:=autoreconf
PKG_VERSION:=3.2.1
-PKG_RELEASE:=2
+PKG_RELEASE:=3
PKG_SOURCE_URL:=https://codeload.github.com/nodogsplash/nodogsplash/tar.gz/v$(PKG_VERSION)?
PKG_SOURCE:=nodogsplash-$(PKG_VERSION).tar.gz
diff --git a/nodogsplash/patches/0001-fix-invalid-pointer-when-clock-is-turned-back.patch b/nodogsplash/patches/0001-fix-invalid-pointer-when-clock-is-turned-back.patch
new file mode 100644
index 0000000..9ea55d0
--- /dev/null
+++ b/nodogsplash/patches/0001-fix-invalid-pointer-when-clock-is-turned-back.patch
@@ -0,0 +1,51 @@
+From af548c1f885e46309baa6aa175a3822fd16afb2a Mon Sep 17 00:00:00 2001
+From: Moritz Warning <moritzwarning@web.de>
+Date: Thu, 14 Mar 2019 17:19:40 +0100
+Subject: [PATCH] fix invalid pointer when clock is turned back
+
+---
+ src/util.c | 12 ++++++------
+ 1 file changed, 6 insertions(+), 6 deletions(-)
+
+diff --git a/src/util.c b/src/util.c
+index 621062d..77228bf 100644
+--- a/src/util.c
++++ b/src/util.c
+@@ -362,14 +362,14 @@ format_duration(time_t from, time_t to, char buf[64])
+ {
+ int days, hours, minutes, seconds;
+ long long int secs;
++ const char *neg = "";
+
+ if (from <= to) {
+ secs = to - from;
+ } else {
+ secs = from - to;
+ // Prepend minus sign
+- buf[0] = '-';
+- buf += 1;
++ neg = "-";
+ }
+
+ days = secs / (24 * 60 * 60);
+@@ -381,13 +381,13 @@ format_duration(time_t from, time_t to, char buf[64])
+ seconds = secs;
+
+ if (days > 0) {
+- sprintf(buf, "%dd %dh %dm %ds", days, hours, minutes, seconds);
++ snprintf(buf, 64, "%s%dd %dh %dm %ds", neg, days, hours, minutes, seconds);
+ } else if (hours > 0) {
+- sprintf(buf, "%dh %dm %ds", hours, minutes, seconds);
++ snprintf(buf, 64, "%s%dh %dm %ds", neg, hours, minutes, seconds);
+ } else if (minutes > 0) {
+- sprintf(buf, "%dm %ds", minutes, seconds);
++ snprintf(buf, 64, "%s%dm %ds", neg, minutes, seconds);
+ } else {
+- sprintf(buf, "%ds", seconds);
++ snprintf(buf, 64, "%s%ds", neg, seconds);
+ }
+
+ return buf;
+--
+2.20.1
+