ソースを参照

fix missing va_end()

Michael Vogt 13 年 前
コミット
11d0fb9199
共有2 個のファイルを変更した3 個の追加0 個の削除を含む
  1. 1 0
      methods/ftp.cc
  2. 2 0
      methods/rsh.cc

+ 1 - 0
methods/ftp.cc

@@ -436,6 +436,7 @@ bool FTPConn::WriteMsg(unsigned int &Ret,string &Text,const char *Fmt,...)
    char S[400];
    char S[400];
    vsnprintf(S,sizeof(S) - 4,Fmt,args);
    vsnprintf(S,sizeof(S) - 4,Fmt,args);
    strcat(S,"\r\n");
    strcat(S,"\r\n");
+   va_end(args);
  
  
    if (Debug == true)
    if (Debug == true)
       cerr << "-> '" << QuoteString(S,"") << "'" << endl;
       cerr << "-> '" << QuoteString(S,"") << "'" << endl;

+ 2 - 0
methods/rsh.cc

@@ -218,6 +218,8 @@ bool RSHConn::WriteMsg(std::string &Text,bool Sync,const char *Fmt,...)
    // sprintf the description
    // sprintf the description
    char S[512];
    char S[512];
    vsnprintf(S,sizeof(S) - 4,Fmt,args);
    vsnprintf(S,sizeof(S) - 4,Fmt,args);
+   va_end(args);
+
    if (Sync == true)
    if (Sync == true)
       strcat(S," 2> /dev/null || echo\n");
       strcat(S," 2> /dev/null || echo\n");
    else
    else