From 30903cc040a868ea9c8463421a261990f46af9e2 Mon Sep 17 00:00:00 2001 From: Jochen Dolze Date: Sun, 28 Apr 2013 10:20:02 +0200 Subject: Fixed bug #1343 found by henkwiedig --- xmltv2vdr.cpp | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/xmltv2vdr.cpp b/xmltv2vdr.cpp index 9533175..b367508 100644 --- a/xmltv2vdr.cpp +++ b/xmltv2vdr.cpp @@ -280,8 +280,15 @@ cGlobals::cGlobals() { if (!CheckEPGDir("/tmp")) { - epgfiledir=NULL; - epgfile=strdup(epgfile_store); + if (!CheckEPGDir("/dev/shm")) + { + epgfiledir=NULL; + epgfile=strdup(epgfile_store); + } + else + { + epgfiledir=strdup("/dev/shm"); + } } else { @@ -312,9 +319,12 @@ cGlobals::cGlobals() char *LangEnv=getenv("LANG"); if (LangEnv) { - codeset=strdup(strchr(LangEnv,'.')); - if (codeset) - codeset++; // skip dot + char *codeset_p=strchr(LangEnv,'.'); + if (codeset_p) + { + codeset_p++; // skip dot + codeset=strdup(codeset_p); + } } } if (!codeset) -- cgit v1.2.3