Avoid arithmetic errors when parsing the round-robin current text

This commit is contained in:
Bill Somerville 2020-07-31 12:39:08 +01:00
parent 846b0b6ed8
commit b05bfecb5f
No known key found for this signature in database
GPG Key ID: D864B06D1E81618F

View File

@ -8039,8 +8039,11 @@ void MainWindow::WSPR_scheduling ()
{
QString t=ui->RoundRobin->currentText();
if(m_mode=="FST4W" and t!="Random") {
int i=t.left (1).toInt () - 1;
int n=t.right(1).toInt();
bool ok;
int i=t.left (1).toInt (&ok) - 1;
if (!ok) return;
int n=t.right (1).toInt (&ok);
if (!ok || 0 == n) return;
qint64 ms = QDateTime::currentMSecsSinceEpoch() % 86400000;
int nsec=ms/1000;