mirror of
https://github.com/nim-lang/Nim.git
synced 2026-02-15 23:54:19 +00:00
prevent index out of bounds error in oserr.nim
This commit is contained in:
@@ -59,7 +59,7 @@ proc raiseOSError*(errorCode: OSErrorCode; additionalInfo = "") {.noinline.} =
|
||||
e.errorCode = errorCode.int32
|
||||
e.msg = osErrorMsg(errorCode)
|
||||
if additionalInfo.len > 0:
|
||||
if e.msg[^1] != '\n': e.msg.add '\n'
|
||||
if e.msg.len > 0 and e.msg[^1] != '\n': e.msg.add '\n'
|
||||
e.msg.add "Additional info: "
|
||||
e.msg.addQuoted additionalInfo
|
||||
if e.msg == "":
|
||||
|
||||
Reference in New Issue
Block a user