From e2c0cff2e385fe9bed1eb97f495cee15518380ef Mon Sep 17 00:00:00 2001 From: Matthew Date: Mon, 25 Nov 2024 11:56:51 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BD=91=E7=BB=9C=E6=91=84=E5=83=8F=E5=A4=B4?= =?UTF-8?q?=E7=94=A8=E6=88=B7=E5=90=8D=E5=92=8C=E5=AF=86=E7=A0=81=E7=9A=84?= =?UTF-8?q?=E8=AE=BE=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/main/cpp/PhoneDevice.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/app/src/main/cpp/PhoneDevice.cpp b/app/src/main/cpp/PhoneDevice.cpp index 5ce32271..5acaeb3f 100644 --- a/app/src/main/cpp/PhoneDevice.cpp +++ b/app/src/main/cpp/PhoneDevice.cpp @@ -1561,7 +1561,14 @@ bool CPhoneDevice::TakePhoto(const IDevice::PHOTO_INFO& photoInfo, const vector< addr.s_addr = localPhotoInfo.ip; strcpy(netPhotoInfo.ip, inet_ntoa(addr)); strcpy(netPhotoInfo.outputPath, path.c_str()); - + if (!localPhotoInfo.userName.empty()) + { + strncpy(netPhotoInfo.userName, localPhotoInfo.userName.c_str(), std::min(sizeof(netPhotoInfo.userName) - 1, localPhotoInfo.userName.size())); + } + if (!localPhotoInfo.password.empty()) + { + strncpy(netPhotoInfo.password, localPhotoInfo.password.c_str(), std::min(sizeof(netPhotoInfo.password) - 1, localPhotoInfo.password.size())); + } // strcpy(netPhotoInfo.interface, "eth0"); std::vector img;