diff options
Diffstat (limited to 'Sluift/component.cpp')
-rw-r--r-- | Sluift/component.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Sluift/component.cpp b/Sluift/component.cpp index f3c2e37..c1b1da4 100644 --- a/Sluift/component.cpp +++ b/Sluift/component.cpp @@ -96,13 +96,13 @@ SLUIFT_LUA_FUNCTION(Component, async_connect) { SluiftComponent* component = getComponent(L); std::string host; - int port = 0; + unsigned short port = 0; if (lua_istable(L, 2)) { if (boost::optional<std::string> hostString = Lua::getStringField(L, 2, "host")) { host = *hostString; } if (boost::optional<int> portInt = Lua::getIntField(L, 2, "port")) { - port = *portInt; + port = boost::numeric_cast<unsigned short>(*portInt); } } component->connect(host, port); |