summary refs log tree commit diff stats
path: root/lib/system.nim
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2018-08-21 20:33:47 +0200
committerAraq <rumpf_a@web.de>2018-08-21 20:33:47 +0200
commitf12a5431a19ac80900fe049e3d44000b891e6273 (patch)
treec920445ca826bd8067080fb8adcc98dba324423c /lib/system.nim
parentddaf2e3805d58cc27244fa719fabee30543dec75 (diff)
downloadNim-f12a5431a19ac80900fe049e3d44000b891e6273.tar.gz
make tests green again
Diffstat (limited to 'lib/system.nim')
-rw-r--r--lib/system.nim1
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/system.nim b/lib/system.nim
index 52ed524be..832a98976 100644
--- a/lib/system.nim
+++ b/lib/system.nim
@@ -4112,6 +4112,7 @@ template once*(body: untyped): untyped =
 {.pop.} #{.push warning[GcMem]: off, warning[Uninit]: off.}
 
 proc substr*(s: string, first, last: int): string =
+  let first = max(first, 0)
   let L = max(min(last, high(s)) - first + 1, 0)
   result = newString(L)
   for i in 0 .. L-1: