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 /svdrpclient.h | |
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 'svdrpclient.h')
-rw-r--r-- | svdrpclient.h | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/svdrpclient.h b/svdrpclient.h index 10bdbae..177ce1f 100644 --- a/svdrpclient.h +++ b/svdrpclient.h @@ -91,21 +91,18 @@ public: } } - bool SendCmd(char* cmd) + bool SendCmd(const char* cmd) { if (!bConnected) return false; - char* szCmd = NULL; - - asprintf(&szCmd, "%s\r\n", cmd); - Send(szCmd); - free(szCmd); + cString szCmd = cString::sprintf("%s\r\n", cmd); + Send(*szCmd); bool cmdret = (Receive() == CMDSUCCESS); - asprintf(&szCmd, "QUIT\r\n"); + szCmd = cString::sprintf("QUIT\r\n"); Send(szCmd); - free(szCmd); + long rc = 0; if ((rc = Receive()) != SVDRPDISCONNECT) LogFile.eSysLog("could not disconnect (%ld)!", rc); @@ -113,7 +110,7 @@ public: close(sock); return cmdret; } - bool Send(char* szSend) + bool Send(const char* szSend) { int length = strlen(szSend); int sent = 0; @@ -147,7 +144,7 @@ public: return -1; } char* Temp = NULL; - asprintf(&Temp, "%s%c", csResp, ch); + msprintf(&Temp, "%s%c", csResp, ch); free(csResp); csResp = Temp; } |