summary refs log tree commit diff stats
path: root/lib
diff options
context:
space:
mode:
authorClyybber <darkmine956@gmail.com>2018-10-28 14:34:05 -0400
committerGitHub <noreply@github.com>2018-10-28 14:34:05 -0400
commit2aa7eeda399e480018dc48eddb5f6d81ce904ee4 (patch)
tree5e83ddd31ee4b647e8249b3113c63d5ddecf5562 /lib
parent9ca1c2c93035341e06d85f56edeb6a08f962a9e8 (diff)
downloadNim-2aa7eeda399e480018dc48eddb5f6d81ce904ee4.tar.gz
actually do ceiling division, not a similar operation
Co-Authored-By: flaviut <tamasflaviu@gmail.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/impure/nre.nim2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/impure/nre.nim b/lib/impure/nre.nim
index 5155194b0..f1f4ae7eb 100644
--- a/lib/impure/nre.nim
+++ b/lib/impure/nre.nim
@@ -470,7 +470,7 @@ proc matchImpl(str: string, pattern: Regex, start, endpos: int, flags: int): Opt
   let vecsize = (pattern.captureCount() + 1) * 3
   # div 2 because each element is 2 cints long
   # plus 1 because we need the ceiling, not the floor
-  myResult.pcreMatchBounds = newSeq[HSlice[cint, cint]]((vecsize div 2) + 1)
+  myResult.pcreMatchBounds = newSeq[HSlice[cint, cint]]((vecsize + 1) div 2)
   myResult.pcreMatchBounds.setLen(vecsize div 3)
 
   let strlen = if endpos == int.high: str.len else: endpos+1