From b38bb4f0b5cf564e007c9248645482f9b0a3c1ab Mon Sep 17 00:00:00 2001 From: Tobias Grimm Date: Thu, 8 Jan 2009 22:04:11 +0100 Subject: replaced asprintf() by cString::sprintf() --- txtrecv.c | 6 ++---- txtrecv.h | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/txtrecv.c b/txtrecv.c index d896441..4395daa 100644 --- a/txtrecv.c +++ b/txtrecv.c @@ -105,7 +105,6 @@ Storage::StorageSystem Storage::system = Storage::StorageSystemPacked; Storage::Storage() { s_self=this; byteCount=0; - currentDir=0; storageOption=-1; failedFreeSpace=false; } @@ -191,9 +190,8 @@ void Storage::getFilename(char *buffer, int bufLength, PageID page) { } void Storage::prepareDirectory(tChannelID chan) { - free(currentDir); - if (asprintf(¤tDir, "%s/%s", root, *chan.ToString()) == -1 || - !MakeDirs(currentDir, 1)) { + currentDir = cString::sprintf("%s/%s", root, *chan.ToString()); + if (!MakeDirs(currentDir, 1)) { esyslog("OSD-Teletext: Error preparing directory for channel \"%s\"", *chan.ToString()); return; diff --git a/txtrecv.h b/txtrecv.h index 927350d..3ea26da 100644 --- a/txtrecv.h +++ b/txtrecv.h @@ -84,7 +84,7 @@ protected: bool exists(const char* file); long byteCount; - char *currentDir; + cString currentDir; private: static StorageSystem system; int storageOption; -- cgit v1.2.3