From bd029fcce944a4f0b1ede27d49694be4c8fd438b Mon Sep 17 00:00:00 2001 From: Klaus Schmidinger Date: Mon, 24 Apr 2000 09:35:29 +0200 Subject: [PATCH] Bugfix in titleBuffer handling --- recording.c | 8 +++++--- recording.h | 4 ++-- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/recording.c b/recording.c index 6d70bd49..2ac20e00 100644 --- a/recording.c +++ b/recording.c @@ -4,7 +4,7 @@ * See the main source file 'osm.c' for copyright information and * 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 @@ -104,6 +104,7 @@ void AssertFreeDiskSpace(void) cRecording::cRecording(const char *Name, time_t Start, int Priority, int LifeTime) { + titleBuffer = NULL; fileName = NULL; name = strdup(Name); start = Start; @@ -113,6 +114,7 @@ cRecording::cRecording(const char *Name, time_t Start, int Priority, int LifeTim cRecording::cRecording(cTimer *Timer) { + titleBuffer = NULL; fileName = NULL; name = strdup(Timer->file); start = Timer->StartTime(); @@ -122,6 +124,7 @@ cRecording::cRecording(cTimer *Timer) cRecording::cRecording(const char *FileName) { + titleBuffer = NULL; fileName = strdup(FileName); FileName += strlen(BaseDir) + 1; char *p = strrchr(FileName, '/'); @@ -140,14 +143,13 @@ cRecording::cRecording(const char *FileName) name[p - FileName] = 0; } } - titleBuffer = NULL; } cRecording::~cRecording() { + delete titleBuffer; delete fileName; delete name; - delete titleBuffer; } const char *cRecording::FileName(void) diff --git a/recording.h b/recording.h index 3151896d..4b75a3a6 100644 --- a/recording.h +++ b/recording.h @@ -4,7 +4,7 @@ * See the main source file 'osm.c' for copyright information and * 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 @@ -20,8 +20,8 @@ class cRecording : public cListObject { friend class cRecordings; private: char *titleBuffer; - char *name; char *fileName; + char *name; public: time_t start; int priority;