1
0
mirror of https://github.com/VDR4Arch/vdr.git synced 2023-10-10 13:36:52 +02:00

Bugfix in titleBuffer handling

This commit is contained in:
Klaus Schmidinger 2000-04-24 09:35:29 +02:00
parent f308fd8b5d
commit bd029fcce9
2 changed files with 7 additions and 5 deletions

View File

@ -4,7 +4,7 @@
* See the main source file 'osm.c' for copyright information and * See the main source file 'osm.c' for copyright information and
* how to reach the author. * how to reach the author.
* *
* $Id: recording.c 1.4 2000/04/23 09:48:35 kls Exp $ * $Id: recording.c 1.5 2000/04/24 09:35:29 kls Exp $
*/ */
#define _GNU_SOURCE #define _GNU_SOURCE
@ -104,6 +104,7 @@ void AssertFreeDiskSpace(void)
cRecording::cRecording(const char *Name, time_t Start, int Priority, int LifeTime) cRecording::cRecording(const char *Name, time_t Start, int Priority, int LifeTime)
{ {
titleBuffer = NULL;
fileName = NULL; fileName = NULL;
name = strdup(Name); name = strdup(Name);
start = Start; start = Start;
@ -113,6 +114,7 @@ cRecording::cRecording(const char *Name, time_t Start, int Priority, int LifeTim
cRecording::cRecording(cTimer *Timer) cRecording::cRecording(cTimer *Timer)
{ {
titleBuffer = NULL;
fileName = NULL; fileName = NULL;
name = strdup(Timer->file); name = strdup(Timer->file);
start = Timer->StartTime(); start = Timer->StartTime();
@ -122,6 +124,7 @@ cRecording::cRecording(cTimer *Timer)
cRecording::cRecording(const char *FileName) cRecording::cRecording(const char *FileName)
{ {
titleBuffer = NULL;
fileName = strdup(FileName); fileName = strdup(FileName);
FileName += strlen(BaseDir) + 1; FileName += strlen(BaseDir) + 1;
char *p = strrchr(FileName, '/'); char *p = strrchr(FileName, '/');
@ -140,14 +143,13 @@ cRecording::cRecording(const char *FileName)
name[p - FileName] = 0; name[p - FileName] = 0;
} }
} }
titleBuffer = NULL;
} }
cRecording::~cRecording() cRecording::~cRecording()
{ {
delete titleBuffer;
delete fileName; delete fileName;
delete name; delete name;
delete titleBuffer;
} }
const char *cRecording::FileName(void) const char *cRecording::FileName(void)

View File

@ -4,7 +4,7 @@
* See the main source file 'osm.c' for copyright information and * See the main source file 'osm.c' for copyright information and
* how to reach the author. * how to reach the author.
* *
* $Id: recording.h 1.4 2000/04/23 09:50:40 kls Exp $ * $Id: recording.h 1.5 2000/04/24 09:33:58 kls Exp $
*/ */
#ifndef __RECORDING_H #ifndef __RECORDING_H
@ -20,8 +20,8 @@ class cRecording : public cListObject {
friend class cRecordings; friend class cRecordings;
private: private:
char *titleBuffer; char *titleBuffer;
char *name;
char *fileName; char *fileName;
char *name;
public: public:
time_t start; time_t start;
int priority; int priority;