Skip to content

Commit

Permalink
Merge pull request #31 from Kususumu/Kususumu-patch-FixLongTimePing
Browse files Browse the repository at this point in the history
Fix a long time ping (about 65536 times ping) cause app crash
  • Loading branch information
samiyr authored Jun 9, 2021
2 parents e52d24e + 983141b commit 25c2112
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Sources/SwiftyPing/SwiftyPing.swift
Original file line number Diff line number Diff line change
Expand Up @@ -532,7 +532,7 @@ public class SwiftyPing: NSObject {

private func incrementSequenceIndex() {
// Handle overflow gracefully
if sequenceIndex >= Int.max {
if sequenceIndex >= UInt16.max {
sequenceIndex = 0
} else {
sequenceIndex += 1
Expand Down

0 comments on commit 25c2112

Please sign in to comment.