summaryrefslogtreecommitdiff
path: root/methods
diff options
context:
space:
mode:
authorMichael Vogt <mvo@debian.org>2014-10-14 09:57:34 +0200
committerMichael Vogt <mvo@debian.org>2014-10-14 09:57:34 +0200
commita4221092e50af0b74040f5b4ee800c78b05fd84e (patch)
tree97e0afa79d72b8ea2206fdac1139d860c49d155a /methods
parent8556d56aabc7162032a55370373d1b8f5af33645 (diff)
parent9227645d6d355f9f4332f400b8d58c8fa8f1e899 (diff)
Merge branch 'debian/sid' into debian/experimental
Diffstat (limited to 'methods')
-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)