From b05bfecb5f5a9f90fbca7432699600d6c9f14765 Mon Sep 17 00:00:00 2001 From: Bill Somerville Date: Fri, 31 Jul 2020 12:39:08 +0100 Subject: [PATCH] Avoid arithmetic errors when parsing the round-robin current text --- widgets/mainwindow.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/widgets/mainwindow.cpp b/widgets/mainwindow.cpp index 8536773ff..7055d3e30 100644 --- a/widgets/mainwindow.cpp +++ b/widgets/mainwindow.cpp @@ -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;