summaryrefslogtreecommitdiff
path: root/methods/rsh.cc
diff options
context:
space:
mode:
authorMichael Vogt <mvo@ubuntu.com>2014-11-03 08:59:19 +0100
committerMichael Vogt <mvo@ubuntu.com>2014-11-03 08:59:19 +0100
commit26f6e9b4c32c937d5a138404a9c1b94809c3afd6 (patch)
tree5208d66e39a8c61ba9e9ade61dc1c03f0711d475 /methods/rsh.cc
parent0c535a8aedc34705ed115754796856a2b5d92a08 (diff)
parent28460cb27846b2437010b08adf10bde18e370974 (diff)
Merge branch 'debian/sid' into ubuntu/master
Conflicts: debian/changelog
Diffstat (limited to 'methods/rsh.cc')
-rw-r--r--methods/rsh.cc13
1 files changed, 8 insertions, 5 deletions
diff --git a/methods/rsh.cc b/methods/rsh.cc
index bd46d2515..0e949160b 100644
--- a/methods/rsh.cc
+++ b/methods/rsh.cc
@@ -218,17 +218,20 @@ bool RSHConn::WriteMsg(std::string &Text,bool Sync,const char *Fmt,...)
va_list args;
va_start(args,Fmt);
- // sprintf the description
- char S[512];
- vsnprintf(S,sizeof(S) - 4,Fmt,args);
+ // sprintf into a buffer
+ char Tmp[1024];
+ vsnprintf(Tmp,sizeof(Tmp),Fmt,args);
va_end(args);
+ // concat to create the real msg
+ std::string Msg;
if (Sync == true)
- strcat(S," 2> /dev/null || echo\n");
+ Msg = std::string(Tmp) + " 2> /dev/null || echo\n";
else
- strcat(S," 2> /dev/null\n");
+ Msg = std::string(Tmp) + " 2> /dev/null\n";
// Send it off
+ const char *S = Msg.c_str();
unsigned long Len = strlen(S);
unsigned long Start = 0;
while (Len != 0)