Simpler bytesSkipped check

This commit is contained in:
Butterscotch!
2025-12-07 04:53:09 -05:00
parent b221250ba7
commit dab6ec28af

View File

@@ -135,9 +135,7 @@ class OTAUpdateTask(
// for the OK response. Saving time
val bytesSkipped = dis.skipBytes(4)
// Replicate behaviour of .skipNBytes()
if (bytesSkipped == 0) {
throw EOFException("Unexpected EOF")
} else if (bytesSkipped != 4) {
if (bytesSkipped != 4) {
throw IOException("Unexpected number of bytes skipped: $bytesSkipped")
}
}