From 9a1a16f3d42b2f48b26eb3daef3a195fc0f2a13e Mon Sep 17 00:00:00 2001 From: Klaus Schmidinger Date: Sun, 11 Aug 2002 13:32:23 +0200 Subject: Consistently using malloc/free and new/delete --- interface.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'interface.c') diff --git a/interface.c b/interface.c index c468223f..8d4da216 100644 --- a/interface.c +++ b/interface.c @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: interface.c 1.53 2002/08/11 10:47:04 kls Exp $ + * $Id: interface.c 1.54 2002/08/11 11:46:47 kls Exp $ */ #include "interface.h" @@ -85,7 +85,7 @@ eKeys cInterface::GetKey(bool Wait) char *message = SVDRP->GetMessage(); if (message) { Info(message); - delete message; + free(message); } } } @@ -214,12 +214,12 @@ char *cInterface::WrapText(const char *Text, int Width, int *Height) // punch in a newline, so we need to make room for it: if (Delim) p = Delim + 1; // let's fall back to the most recent delimiter - char *s = new char[strlen(t) + 2]; // The additional '\n' plus the terminating '\0' + char *s = MALLOC(char, strlen(t) + 2); // The additional '\n' plus the terminating '\0' int l = p - t; strncpy(s, t, l); s[l] = '\n'; strcpy(s + l + 1, p); - delete t; + free(t); t = s; p = t + l; continue; @@ -400,7 +400,7 @@ void cInterface::QueryKeys(void) char *Prompt; asprintf(&Prompt, tr("Press key for '%s'"), tr(k->name)); WriteText(1, 5, Prompt); - delete Prompt; + free(Prompt); for (;;) { unsigned int ch = GetCh(); if (ch != 0) { -- cgit v1.2.3