summaryrefslogtreecommitdiffstats
path: root/libsysutils/src/SocketClient.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'libsysutils/src/SocketClient.cpp')
-rw-r--r--libsysutils/src/SocketClient.cpp15
1 files changed, 3 insertions, 12 deletions
diff --git a/libsysutils/src/SocketClient.cpp b/libsysutils/src/SocketClient.cpp
index f0e846f4f..857ed4d10 100644
--- a/libsysutils/src/SocketClient.cpp
+++ b/libsysutils/src/SocketClient.cpp
@@ -33,19 +33,10 @@ int SocketClient::sendMsg(const char *msg) {
return -1;
}
- char *tmp;
- const char *bp = msg;
-
- if (msg[strlen(msg)] != '\n') {
- tmp = (char *) alloca(strlen(msg) + 1);
- strcpy(tmp, msg);
- strcat(tmp, "\n");
- bp = tmp;
- }
-
+ // Send the message including null character
int rc = 0;
- const char *p = bp;
- int brtw = strlen(bp);
+ const char *p = msg;
+ int brtw = strlen(msg) + 1;
pthread_mutex_lock(&mWriteMutex);
while(brtw) {