Skip to content

Commit

Permalink
FString::Printf usage updated to accomodate to UE 4.20 changes.
Browse files Browse the repository at this point in the history
  • Loading branch information
RVillani committed Sep 5, 2018
1 parent d113937 commit 874aa5f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion UE4Duino/Source/UE4Duino/Private/Serial.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,11 @@ bool USerial::Open(int32 nPort, int32 nBaud)
return false;
}

FString szPort = FString::Printf(nPort < 10 ? TEXT("COM%d") : TEXT("\\\\.\\COM%d"), nPort);
FString szPort;
if (nPort < 10)
szPort = FString::Printf(TEXT("COM%d"));
else
szPort = FString::Printf(TEXT("\\\\.\\COM%d"));
DCB dcb;

m_hIDComDev = CreateFile(*szPort, GENERIC_READ | GENERIC_WRITE, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL | FILE_FLAG_OVERLAPPED, NULL);
Expand Down
2 changes: 1 addition & 1 deletion UE4Duino/UE4Duino.uplugin
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"Description": "Enables communication between UE4 and COM ports",
"Category": "Input",

"EnabledByDefault": true,
"EnabledByDefault": false,

"Modules": [
{
Expand Down

0 comments on commit 874aa5f

Please sign in to comment.