Skip to content

Commit 522ed12

Browse files
committed
Fix SL and WP compile.
1 parent bd80199 commit 522ed12

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/Renci.SshNet/ScpClient.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -400,10 +400,11 @@ private string ReadString(Stream stream)
400400
b = ReadByte(stream);
401401
}
402402

403-
if (hasError)
404-
throw new ScpException(ConnectionInfo.Encoding.GetString(buffer.ToArray()));
403+
var readBytes = buffer.ToArray();
405404

406-
return ConnectionInfo.Encoding.GetString(buffer.ToArray());
405+
if (hasError)
406+
throw new ScpException(ConnectionInfo.Encoding.GetString(readBytes, 0, readBytes.Length));
407+
return ConnectionInfo.Encoding.GetString(readBytes, 0, readBytes.Length);
407408
}
408409
}
409410
}

0 commit comments

Comments
 (0)