Him188 5 年 前
コミット
47a288c614

+ 1 - 1
mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/network/highway/HighwayHelper.kt

@@ -140,7 +140,7 @@ internal object HighwayHelper {
                     val headLength = readInt()
                     val headLength = readInt()
                     discardExact(4)
                     discardExact(4)
                     val proto = readProtoBuf(CSDataHighwayHead.RspDataHighwayHead.serializer(), length = headLength)
                     val proto = readProtoBuf(CSDataHighwayHead.RspDataHighwayHead.serializer(), length = headLength)
-                    check(proto.errorCode == 0) { "image upload failed: Transfer errno=${proto.errorCode}" }
+                    check(proto.errorCode == 0) { "highway transfer failed, error ${proto.errorCode}" }
                 }
                 }
             }
             }
         }
         }

+ 1 - 1
mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/utils/byteArrays.kt

@@ -94,7 +94,7 @@ internal fun UByteArray.toUHexString(separator: String = " ", offset: Int = 0, l
 
 
 @Suppress("NOTHING_TO_INLINE")
 @Suppress("NOTHING_TO_INLINE")
 internal inline fun ByteArray.encodeToString(offset: Int = 0, charset: Charset = Charsets.UTF_8): String =
 internal inline fun ByteArray.encodeToString(offset: Int = 0, charset: Charset = Charsets.UTF_8): String =
-    String(this, charset = charset, offset = offset)
+    String(this, charset = charset, offset = offset, length = this.size - offset)
 
 
 @PublishedApi
 @PublishedApi
 internal inline fun ByteArray.toReadPacket(offset: Int = 0, length: Int = this.size - offset) =
 internal inline fun ByteArray.toReadPacket(offset: Int = 0, length: Int = this.size - offset) =