Minor fixes to strings and ui, crash fixed #63

This commit is contained in:
Arty Bishop committed 2022-05-18 19:00:48 +01:00
1 parent a2f37e6b9f
commit 278c06170b
16 files changed
+157 -177

No files matched your search

@@ -67,7 +67,8 @@ fun String.isValidIPv4(): Boolean {
}
fun String.isValidPort(): Boolean {
return this.isNotEmpty() && this.toInt() in 1024..65535
val port = "([1-9]|[1-9]\\d{1,3}|[1-5]\\d{4}|6[0-4]\\d{3}|65[0-4]\\d{2}|655[0-2]\\d|6553[0-5])"
return this.matches(port.toRegex()) && this.toInt() in 1024..65535
}
fun ping(hostname: String, port: Int): Int {