Test port number string conversion to short instead of int

Port numbers have a small range and are typically expressed as short ints.
Therefore test the string conversion to short instead.
This commit is contained in:
Roland Winklmeier
2018-08-07 14:43:22 +02:00
committed by Klaus Basan
parent 6a8658f04c
commit 461d146619

View File

@@ -367,7 +367,7 @@ namespace BlackMisc
QString p = port.toLower().trimmed();
if (!p.isEmpty())
{
p.toInt(&ok);
p.toShort(&ok);
if (!ok)
{
p = ""; // was not a number