From 08a750214c84b0ac3a2bfb0ebe291ac9396c07e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20Sundstr=C3=B6m?= Date: Wed, 23 Feb 2011 01:54:33 +0000 Subject: [PATCH] Unsafe use of strncpy replaced by strlcpy. CID 2237. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40633 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/apps/codycam/CodyCam.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/apps/codycam/CodyCam.cpp b/src/apps/codycam/CodyCam.cpp index 2dc01eb27d..14a066a884 100644 --- a/src/apps/codycam/CodyCam.cpp +++ b/src/apps/codycam/CodyCam.cpp @@ -568,8 +568,8 @@ VideoWindow::MessageReceived(BMessage* message) switch (message->what) { case msg_filename: if (control != NULL) { - strncpy(fFtpInfo.fileNameText, - ((BTextControl*)control)->Text(), 63); + strlcpy(fFtpInfo.fileNameText, + ((BTextControl*)control)->Text(), 64); FTPINFO("file is '%s'\n", fFtpInfo.fileNameText); } break; @@ -600,7 +600,7 @@ VideoWindow::MessageReceived(BMessage* message) case msg_server: if (control != NULL) { - strncpy(fFtpInfo.serverText, + strlcpy(fFtpInfo.serverText, ((BTextControl*)control)->Text(), 64); FTPINFO("server = '%s'\n", fFtpInfo.serverText); } @@ -608,7 +608,7 @@ VideoWindow::MessageReceived(BMessage* message) case msg_login: if (control != NULL) { - strncpy(fFtpInfo.loginText, + strlcpy(fFtpInfo.loginText, ((BTextControl*)control)->Text(), 64); FTPINFO("login = '%s'\n", fFtpInfo.loginText); } @@ -616,7 +616,7 @@ VideoWindow::MessageReceived(BMessage* message) case msg_password: if (control != NULL) { - strncpy(fFtpInfo.passwordText, + strlcpy(fFtpInfo.passwordText, ((BTextControl*)control)->Text(), 64); FTPINFO("password = '%s'\n", fFtpInfo.passwordText); } @@ -624,7 +624,7 @@ VideoWindow::MessageReceived(BMessage* message) case msg_directory: if (control != NULL) { - strncpy(fFtpInfo.directoryText, + strlcpy(fFtpInfo.directoryText, ((BTextControl*)control)->Text(), 64); FTPINFO("directory = '%s'\n", fFtpInfo.directoryText); }