Deprecate TaintedString (#15423)
Co-authored-by: Timothee Cour <timothee.cour2@gmail.com> Co-authored-by: Dominik Picheta <dominikpicheta@googlemail.com>
This commit is contained in:
parent
7b632f9ccb
commit
78a99587a4
36 changed files with 184 additions and 229 deletions
|
|
@ -1,7 +1,7 @@
|
|||
import streams
|
||||
from strutils import repeat
|
||||
|
||||
proc readPaddedStr*(s: PStream, length: int, padChar = '\0'): TaintedString =
|
||||
proc readPaddedStr*(s: PStream, length: int, padChar = '\0'): string =
|
||||
var lastChr = length
|
||||
result = s.readStr(length)
|
||||
while lastChr >= 0 and result[lastChr - 1] == padChar: dec(lastChr)
|
||||
|
|
@ -16,7 +16,7 @@ proc writePaddedStr*(s: PStream, str: string, length: int, padChar = '\0') =
|
|||
else:
|
||||
s.write(str)
|
||||
|
||||
proc readLEStr*(s: PStream): TaintedString =
|
||||
proc readLEStr*(s: PStream): string =
|
||||
var len = s.readInt16()
|
||||
result = s.readStr(len)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue