diff options
author | Christian Wieninger <cwieninger (at) gmx (dot) de> | 2008-02-20 17:47:50 +0100 |
---|---|---|
committer | Christian Wieninger <cwieninger (at) gmx (dot) de> | 2008-02-20 17:47:50 +0100 |
commit | 1ca3263b1febbef86071eaaa4e8eda0bbac578fa (patch) | |
tree | 51acae08ac515eba84e01c76261a7735665dd601 /changrp.c | |
parent | 57d0cbd75c591e450e4d11a45ac6a016de48b8cf (diff) | |
download | vdr-plugin-epgsearch-1ca3263b1febbef86071eaaa4e8eda0bbac578fa.tar.gz vdr-plugin-epgsearch-1ca3263b1febbef86071eaaa4e8eda0bbac578fa.tar.bz2 |
replaced asprintf with cString::sprintf and a wrapper function
Diffstat (limited to 'changrp.c')
-rw-r--r-- | changrp.c | 24 |
1 files changed, 9 insertions, 15 deletions
@@ -111,13 +111,13 @@ const char *cChannelGroup::ToText(void) else { char* temp = channelbuffer; - asprintf(&channelbuffer, "%s|%s", channelbuffer, CHANNELSTRING(channel)); + msprintf(&channelbuffer, "%s|%s", channelbuffer, CHANNELSTRING(channel)); free(temp); } ChannelGroupItem = channels.Next(ChannelGroupItem); } char* buffer = NULL; - asprintf(&buffer, "%s|%s", name, channelbuffer); + msprintf(&buffer, "%s|%s", name, channelbuffer); free(channelbuffer); return buffer; } @@ -258,7 +258,7 @@ cMenuChannelGroupItem::cMenuChannelGroupItem(cChannelGroup* Group) void cMenuChannelGroupItem::Set(void) { - char* channelbuffer = NULL; + cString channelbuffer; cChannelGroupItem* channelInGroup = group->channels.First(); int channelNr, chIntBegin = -1, chIntEnd = -1, chLast = -1; @@ -276,9 +276,9 @@ void cMenuChannelGroupItem::Set(void) { chIntEnd = chLast; if(chIntBegin == chIntEnd) - asprintf(&channelbuffer, "%s %d", channelbuffer?channelbuffer:"", chIntBegin); + channelbuffer = cString::sprintf("%s %d", *channelbuffer?*channelbuffer:"", chIntBegin); else if (chIntEnd != -1) - asprintf(&channelbuffer, "%s %d-%d", channelbuffer?channelbuffer:"", chIntBegin, chIntEnd); + channelbuffer = cString::sprintf("%s %d-%d", *channelbuffer?*channelbuffer:"", chIntBegin, chIntEnd); chIntBegin = chIntEnd = channelNr; } @@ -287,17 +287,13 @@ void cMenuChannelGroupItem::Set(void) if (!channelInGroup) { if(chLast == chIntBegin) - asprintf(&channelbuffer, "%s %d", channelbuffer?channelbuffer:"", chIntBegin); + channelbuffer = cString::sprintf("%s %d", *channelbuffer?*channelbuffer:"", chIntBegin); else - asprintf(&channelbuffer, "%s %d-%d", channelbuffer?channelbuffer:"", chIntBegin, chLast); + channelbuffer = cString::sprintf("%s %d-%d", *channelbuffer?*channelbuffer:"", chIntBegin, chLast); } } - - char* buffer = NULL; - asprintf(&buffer, "%s\t%s", group->name, channelbuffer?channelbuffer:""); - free(channelbuffer); - SetText(buffer, false); + SetText(cString::sprintf("%s\t%s", group->name, *channelbuffer?*channelbuffer:"")); } // --- cMenuChannelGroups ---------------------------------------------------------- @@ -346,10 +342,8 @@ eOSState cMenuChannelGroups::Delete(void) cSearchExt* search = ChannelGroups.Used(curGroup); if (search) { - char* Message = NULL; - asprintf(&Message, "%s %s", tr("Channel group used by:"), search->search); + cString Message = cString::sprintf("%s %s", tr("Channel group used by:"), search->search); Skins.Message(mtInfo, Message); - free(Message); return osContinue; } if (Interface->Confirm(tr("Edit$Delete group?"))) { |