Commit 3969843b authored by Geoff Simmons's avatar Geoff Simmons

bugfix the check whether workspace is sufficient in the C++ interface

for sub()
parent 2101e6d4
......@@ -180,7 +180,7 @@ vre2_replace(vre2 *vre2, const char * const text, const char * const rewrite,
*match = vre2->replace(&t, rewrite);
if (!*match)
return NULL;
if (t.size() > bytes + 1)
if (t.size() + 1 > bytes)
throw runtime_error("insufficient workspace");
*len = t.size() + 1;
t.copy(dest, *len);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment