瀏覽代碼

Fix SL and WP compile.

Gert Driesen 8 年之前
父節點
當前提交
522ed129b2
共有 1 個文件被更改,包括 4 次插入3 次删除
  1. 4 3
      src/Renci.SshNet/ScpClient.cs

+ 4 - 3
src/Renci.SshNet/ScpClient.cs

@@ -400,10 +400,11 @@ namespace Renci.SshNet
                 b = ReadByte(stream);
             }
 
-            if (hasError)
-                throw new ScpException(ConnectionInfo.Encoding.GetString(buffer.ToArray()));
+            var readBytes = buffer.ToArray();
 
-            return ConnectionInfo.Encoding.GetString(buffer.ToArray());
+            if (hasError)
+                throw new ScpException(ConnectionInfo.Encoding.GetString(readBytes, 0, readBytes.Length));
+            return ConnectionInfo.Encoding.GetString(readBytes, 0, readBytes.Length);
         }
     }
 }