diff options
author | Michael Vogt <mvo@debian.org> | 2014-10-14 09:57:34 +0200 |
---|---|---|
committer | Michael Vogt <mvo@debian.org> | 2014-10-14 09:57:34 +0200 |
commit | a4221092e50af0b74040f5b4ee800c78b05fd84e (patch) | |
tree | 97e0afa79d72b8ea2206fdac1139d860c49d155a /methods | |
parent | 8556d56aabc7162032a55370373d1b8f5af33645 (diff) | |
parent | 9227645d6d355f9f4332f400b8d58c8fa8f1e899 (diff) |
Merge branch 'debian/sid' into debian/experimental
Diffstat (limited to 'methods')
-rw-r--r-- | methods/rsh.cc | 13 |
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) |