mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-30 11:55:35 +08:00
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:
committed by
Klaus Basan
parent
6a8658f04c
commit
461d146619
@@ -367,7 +367,7 @@ namespace BlackMisc
|
|||||||
QString p = port.toLower().trimmed();
|
QString p = port.toLower().trimmed();
|
||||||
if (!p.isEmpty())
|
if (!p.isEmpty())
|
||||||
{
|
{
|
||||||
p.toInt(&ok);
|
p.toShort(&ok);
|
||||||
if (!ok)
|
if (!ok)
|
||||||
{
|
{
|
||||||
p = ""; // was not a number
|
p = ""; // was not a number
|
||||||
|
|||||||
Reference in New Issue
Block a user