Skip to content

Commit e4df0e8

Browse files
authored
[FileManager] Fix off by one error when checking error from read in FileManager+Basics (#1624)
Check for readBytes being equal to -1, not less than -1. It returns -1 when there's an error.
1 parent 8eb80f2 commit e4df0e8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Sources/FoundationEssentials/FileManager/FileManager+Basics.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ internal struct _FileManagerImpl {
277277
return false
278278
}
279279
}
280-
if readBytes < -1 { return false }
280+
if readBytes == -1 { return false }
281281
return true
282282
}
283283
}

0 commit comments

Comments
 (0)