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

Changed a few leftover 'new char[...]' to MALLOC(char, ...)

This commit is contained in:
Klaus Schmidinger 2002-10-13 09:11:16 +02:00
parent e58fa67e6c
commit e2aee54d12
2 changed files with 6 additions and 5 deletions

View File

@ -1602,3 +1602,4 @@ Video Disk Recorder Revision History
- Commands in the file 'commands.conf' can now have a '?' at the end of their - Commands in the file 'commands.conf' can now have a '?' at the end of their
title, which will result in a confirmation prompt before executing the title, which will result in a confirmation prompt before executing the
command. command.
- Changed a few leftover 'new char[...]' to MALLOC(char, ...).

View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and * See the main source file 'vdr.c' for copyright information and
* how to reach the author. * how to reach the author.
* *
* $Id: recording.c 1.68 2002/10/05 13:44:56 kls Exp $ * $Id: recording.c 1.69 2002/10/13 09:08:45 kls Exp $
*/ */
#include "recording.h" #include "recording.h"
@ -363,7 +363,7 @@ cRecording::cRecording(const char *FileName)
t.tm_mon--; t.tm_mon--;
t.tm_sec = 0; t.tm_sec = 0;
start = mktime(&t); start = mktime(&t);
name = new char[p - FileName + 1]; name = MALLOC(char, p - FileName + 1);
strncpy(name, FileName, p - FileName); strncpy(name, FileName, p - FileName);
name[p - FileName] = 0; name[p - FileName] = 0;
name = ExchangeChars(name, false); name = ExchangeChars(name, false);
@ -511,7 +511,7 @@ const char *cRecording::Title(char Delimiter, bool NewIndicator, int Level)
break; break;
} }
} }
titleBuffer = new char[s - p + 3]; titleBuffer = MALLOC(char, s - p + 3);
*titleBuffer = Delimiter; *titleBuffer = Delimiter;
*(titleBuffer + 1) = Delimiter; *(titleBuffer + 1) = Delimiter;
strn0cpy(titleBuffer + 2, p, s - p + 1); strn0cpy(titleBuffer + 2, p, s - p + 1);
@ -769,7 +769,7 @@ cIndexFile::cIndexFile(const char *FileName, bool Record)
last = -1; last = -1;
index = NULL; index = NULL;
if (FileName) { if (FileName) {
fileName = new char[strlen(FileName) + strlen(INDEXFILESUFFIX) + 1]; fileName = MALLOC(char, strlen(FileName) + strlen(INDEXFILESUFFIX) + 1);
if (fileName) { if (fileName) {
strcpy(fileName, FileName); strcpy(fileName, FileName);
char *pFileExt = fileName + strlen(fileName); char *pFileExt = fileName + strlen(fileName);
@ -996,7 +996,7 @@ cFileName::cFileName(const char *FileName, bool Record, bool Blocking)
record = Record; record = Record;
blocking = Blocking; blocking = Blocking;
// Prepare the file name: // Prepare the file name:
fileName = new char[strlen(FileName) + RECORDFILESUFFIXLEN]; fileName = MALLOC(char, strlen(FileName) + RECORDFILESUFFIXLEN);
if (!fileName) { if (!fileName) {
esyslog("ERROR: can't copy file name '%s'", fileName); esyslog("ERROR: can't copy file name '%s'", fileName);
return; return;