Closed lucabaldini closed 8 years ago
And a cursory look indicates that this might be fixed by changing a couple of strcpy_s
in CQuickUsb.cpp
#if defined(_WIN32)
size_t size = strlen(devName) + 1;
m_devName = new QCHAR[size];
strcpy_s(m_devName, size, devName);
#else
int size = strlen(devName) + 1;
m_devName = new QCHAR[size];
strcpy(m_devName, devName);
#endif
Trying to push this diff:
diff --git a/quickusb-2.15.2/CQuickUsb.cpp b/quickusb-2.15.2/CQuickUsb.cpp
index ab1b723..b391a3b 100644
--- a/quickusb-2.15.2/CQuickUsb.cpp
+++ b/quickusb-2.15.2/CQuickUsb.cpp
@@ -49,15 +49,15 @@ CQuickUsb::CQuickUsb(PCQCHAR devName) :
m_lastError(QUICKUSB_ERROR_NO_ERROR),
m_lastDriverError(QUICKUSB_ERROR_NO_ERROR) {
-#if defined(_WIN32)
- size_t size = strlen(devName) + 1;
- m_devName = new QCHAR[size];
- strcpy_s(m_devName, size, devName);
-#else
+ //#if defined(_WIN32)
+ //size_t size = strlen(devName) + 1;
+ //m_devName = new QCHAR[size];
+ //strcpy_s(m_devName, size, devName);
+ //#else
int size = strlen(devName) + 1;
m_devName = new QCHAR[size];
strcpy(m_devName, devName);
-#endif
+ //#endif
}
@@ -96,15 +96,15 @@ void CQuickUsb::SetName(PCQCHAR name) {
delete [] m_devName;
}
-#if defined(_WIN32)
- size_t size = strlen(name) + 1;
- m_devName = new QCHAR[size];
- strcpy_s(m_devName, size, name);
-#else
+ //#if defined(_WIN32)
+ //size_t size = strlen(name) + 1;
+ //m_devName = new QCHAR[size];
+ //strcpy_s(m_devName, size, name);
+ //#else
int size = strlen(name) + 1;
m_devName = new QCHAR[size];
strcpy(m_devName, name);
-#endif
+ //#endif
}
@@ -114,15 +114,15 @@ void CQuickUsb::SetDeviceName(PCQCHAR name) {
delete [] m_devName;
}
-#if defined(_WIN32)
- size_t size = strlen(name) + 1;
- m_devName = new QCHAR[size];
- strcpy_s(m_devName, size, name);
-#else
+ //#if defined(_WIN32)
+ //size_t size = strlen(name) + 1;
+ //m_devName = new QCHAR[size];
+ //strcpy_s(m_devName, size, name);
+ //#else
int size = strlen(name) + 1;
m_devName = new QCHAR[size];
strcpy(m_devName, name);
-#endif
+ //#endif
}
This is of course transparent to Linux and seems to be working under Windows 64 bit as well.
Still need to be tested under Windows 32 bit.
Tested, we're up and running.