From e8fdfbcea6f2028972d74b65c52d6e7d1aea214c Mon Sep 17 00:00:00 2001 From: Edoardo La Greca Date: Wed, 6 Aug 2025 20:06:55 +0200 Subject: use count more wisely in write --- src/main/kotlin/Connection.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/kotlin/Connection.kt b/src/main/kotlin/Connection.kt index 564e8a7..6444ade 100644 --- a/src/main/kotlin/Connection.kt +++ b/src/main/kotlin/Connection.kt @@ -153,6 +153,7 @@ class Connection(transLay: TransportLayer) : ProtocolTranslator { } override fun write(fid: UInt, offset: ULong, count: UInt, data: Iterable): Pair { + val data = data.take(count.toInt()).toTypedArray() val omsg = OutMessage(NinePMessageType.TWRITE, this.tagGen.generate(), listOf("offset", "count", "data"), mapOf( "offset" to BigInteger(offset.toString()), @@ -160,7 +161,7 @@ class Connection(transLay: TransportLayer) : ProtocolTranslator { ), emptyMap(), mapOf( - "data" to data.toList().toTypedArray() + "data" to data ), this.maxSize ) -- cgit v1.2.3