mirror of
https://github.com/nim-lang/Nim.git
synced 2026-01-03 19:52:36 +00:00
Dont convert string to cstring when writing to stream.
This commit is contained in:
@@ -148,7 +148,10 @@ proc write*[T](s: Stream, x: T) =
|
||||
proc write*(s: Stream, x: string) =
|
||||
## writes the string `x` to the the stream `s`. No length field or
|
||||
## terminating zero is written.
|
||||
writeData(s, cstring(x), x.len)
|
||||
when nimvm:
|
||||
writeData(s, cstring(x), x.len)
|
||||
else:
|
||||
if x.len > 0: writeData(s, unsafeAddr x[0], x.len)
|
||||
|
||||
proc writeLn*(s: Stream, args: varargs[string, `$`]) {.deprecated.} =
|
||||
## **Deprecated since version 0.11.4:** Use **writeLine** instead.
|
||||
|
||||
Reference in New Issue
Block a user