From 6b48b59dafd86493851cb1dd764e034424ce5d9d Mon Sep 17 00:00:00 2001 From: Murai Takashi Date: Thu, 15 Oct 2020 18:34:24 +0900 Subject: [PATCH] codycam: Fix -Wformat-security MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I6dfaebc1cfa8b9881bd25c2105cc949ca0711108 Reviewed-on: https://review.haiku-os.org/c/haiku/+/3326 Reviewed-by: Jérôme Duval --- src/apps/codycam/FtpClient.cpp | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/apps/codycam/FtpClient.cpp b/src/apps/codycam/FtpClient.cpp index 594602f37f..da8a308b70 100644 --- a/src/apps/codycam/FtpClient.cpp +++ b/src/apps/codycam/FtpClient.cpp @@ -448,10 +448,11 @@ FtpClient::_SendRequest(const string& cmd) string ccmd = cmd; if (fControl != 0) { - if (cmd.find("PASS") != string::npos) - printf(B_TRANSLATE("PASS (real password sent)\n")); - else - printf("%s\n", ccmd.c_str()); + if (cmd.find("PASS") != string::npos) { + puts(B_TRANSLATE("PASS (real password sent)")); + } else { + puts(ccmd.c_str()); + } ccmd += "\r\n"; if (fControl->Send(ccmd.c_str(), ccmd.length()) >= 0) @@ -549,8 +550,8 @@ FtpClient::_GetReply(string& outString, int& outCode, int& codeType) rc = _GetReplyLine(line); if (rc == true) { outString = line; + puts(outString.c_str()); outString += '\n'; - printf(outString.c_str()); tempString = line.substr(0, 3); outCode = atoi(tempString.c_str()); @@ -558,8 +559,8 @@ FtpClient::_GetReply(string& outString, int& outCode, int& codeType) rc = _GetReplyLine(line); while (rc == true) { outString += line; + puts(outString.c_str()); outString += '\n'; - printf(outString.c_str()); // we're done with nnn when we get to a "nnn blahblahblah" if ((line.find(tempString) == 0) && line[3] == ' ') break; @@ -609,8 +610,8 @@ FtpClient::_OpenDataConnection() if (_GetReply(replyString, code, codeType)) { if (codeType == 2) { - // It should give us something like: - // "227 Entering Passive Mode (192,168,1,1,10,187)" + // It should give us something like: + // "227 Entering Passive Mode (192,168,1,1,10,187)" int paddr[6]; unsigned char ucaddr[6];