summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2021-12-30 14:38:40 +0100
committerKlaus Schmidinger <vdr@tvdr.de>2021-12-30 14:38:40 +0100
commitd05765c670befc42e55b05a0fd75bb7771076c04 (patch)
tree3d825bdb8dcf76a5306b1d5ffaef807732d8ec8a
parenta5a4b72d1c20c3a97e268365f90060707feaf4b2 (diff)
downloadvdr-d05765c670befc42e55b05a0fd75bb7771076c04.tar.gz
vdr-d05765c670befc42e55b05a0fd75bb7771076c04.tar.bz2
Replaced strncpy() with memcpy() in strreplace() to avoid a compiler warning
-rw-r--r--CONTRIBUTORS1
-rw-r--r--HISTORY5
-rw-r--r--tools.c4
3 files changed, 8 insertions, 2 deletions
diff --git a/CONTRIBUTORS b/CONTRIBUTORS
index 4a13b439..96d544cf 100644
--- a/CONTRIBUTORS
+++ b/CONTRIBUTORS
@@ -2200,6 +2200,7 @@ Marko Mäkelä <marko.makela@hut.fi>
for suggesting to simplify some conditional expressions in skinlcars.c and skinsttng.c
for reporting some uninitialized item area coordinates in cSkinLCARSDisplayMenu
for reporting a problem with the video directory not being set correctly with --edit
+ for reporting a compiler warning about the use of strncpy() in strreplace()
Patrick Rother <krd-vdr@gulu.net>
for reporting a bug in defining timers that only differ in the day of week
diff --git a/HISTORY b/HISTORY
index 2c6e3682..3e101289 100644
--- a/HISTORY
+++ b/HISTORY
@@ -9765,3 +9765,8 @@ Video Disk Recorder Revision History
- Fixed calculating the disk use percentage if there's more than 20TB of recordings
(reported by Timo Weingärtner).
- Official release.
+
+2021-12-30:
+
+- Replaced strncpy() with memcpy() in strreplace() to avoid a compiler warning
+ (reported by Marco Mäkelä).
diff --git a/tools.c b/tools.c
index 8267d290..e86cf853 100644
--- a/tools.c
+++ b/tools.c
@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: tools.c 5.4 2021/05/20 10:13:43 kls Exp $
+ * $Id: tools.c 5.5 2021/12/30 14:35:40 kls Exp $
*/
#include "tools.h"
@@ -170,7 +170,7 @@ char *strreplace(char *s, const char *s1, const char *s2)
char *sof = s + of;
if (l2 != l1)
memmove(sof + l2, sof + l1, l - of - l1 + 1);
- strncpy(sof, s2, l2);
+ memcpy(sof, s2, l2);
}
return s;
}