Add a check for valid timezones.

This commit is contained in:
Andrius Štikonas 2015-11-15 03:09:37 +00:00
parent 4e89c2a6c7
commit a4f74c24b1
2 changed files with 5 additions and 2 deletions

View File

@ -108,7 +108,10 @@ void ConsoleReader::run()
int timezone;
std::cout << "Please enter a new timezone (integer from -11 to 12): ";
std::cin >> timezone;
(*sockets) [number]->changeTimezone(timezone);
if (timezone >= -11 && timezone <= 12)
(*sockets) [number]->changeTimezone(timezone);
else
std::cout << "Invalid timezone";
break;
}
default:

View File

@ -23,7 +23,7 @@
</rect>
</property>
<property name="text">
<string>PushButton</string>
<string></string>
</property>
</widget>
<widget class="QWidget" name="">