summaryrefslogtreecommitdiff
path: root/tools.c
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2020-12-29 21:40:29 +0100
committerKlaus Schmidinger <vdr@tvdr.de>2020-12-29 21:40:29 +0100
commit55b237dbe83acce70649d118b1fb69067f96b661 (patch)
treedf1227f4c62f62ed76c18c148600e1fad5ba9582 /tools.c
parent2b3556b460665d9a4036b1623e7e7ff5ff6d37d8 (diff)
downloadvdr-55b237dbe83acce70649d118b1fb69067f96b661.tar.gz
vdr-55b237dbe83acce70649d118b1fb69067f96b661.tar.bz2
Fixed strreplace() to handle NULL strings
Diffstat (limited to 'tools.c')
-rw-r--r--tools.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/tools.c b/tools.c
index 046829f0..88bfad32 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.1 2020/12/26 15:49:01 kls Exp $
+ * $Id: tools.c 5.2 2020/12/29 21:40:29 kls Exp $
*/
#include "tools.h"
@@ -151,6 +151,8 @@ char *strreplace(char *s, char c1, char c2)
char *strreplace(char *s, const char *s1, const char *s2)
{
+ if (!s || !s1 || !s2)
+ return s;
char *p = strstr(s, s1);
if (p) {
int of = p - s;