Skip to content

Commit 6fcd8ad

Browse files
authored
Merge pull request #9 from Archinamon/fix_posix_readBytes
fix readBytes in posix with ending 0
2 parents 783bb64 + 4675efb commit 6fcd8ad

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ plugins {
66
}
77

88
group = "me.archinamon"
9-
version = "1.3.7"
9+
version = "1.3.8"
1010

1111
val isRunningInIde: Boolean = System.getProperty("idea.active")
1212
?.toBoolean() == true

src/posixMain/kotlin/File.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ actual fun File.readBytes(): ByteArray {
298298
val size = ftell(fd).convert<Int>()
299299
fseek(fd, 0, SEEK_SET)
300300

301-
return ByteArray(size + 1).also { buffer ->
301+
return ByteArray(size).also { buffer ->
302302
fread(buffer.refTo(0), 1UL, size.convert(), fd)
303303
.ensureUnixCallResult("fread") { ret -> ret > 0U }
304304
}

0 commit comments

Comments
 (0)