mirror of
https://github.com/moonlight-stream/moonlight-qt.git
synced 2026-11-27 00:05:11 +00:00
Validate that a predefined PIN consists of 4 digits
This commit is contained in:
1 parent
dd795e35b6
commit
bd405f57ca
1 file changed
+1
-1
@@ -278,7 +278,7 @@ void PairCommandLineParser::parse(const QStringList &args)
|
||||
}
|
||||
m_Host = parser.positionalArguments().at(1);
|
||||
m_PredefinedPin = parser.value("pin");
|
||||
if (!m_PredefinedPin.isEmpty() && m_PredefinedPin.length() != 4) {
|
||||
if (!m_PredefinedPin.isEmpty() && !QRegularExpression("^\\d{4}$").match(m_PredefinedPin).hasMatch()) {
|
||||
parser.showError("PIN must be 4 digits");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user