aboutsummaryrefslogtreecommitdiffstats
path: root/builtin.c
diff options
context:
space:
mode:
authorAndrew J. Schorr <aschorr@telemetry-investments.com>2014-12-14 10:27:32 -0500
committerAndrew J. Schorr <aschorr@telemetry-investments.com>2014-12-14 10:27:32 -0500
commitb6ac928a53d146233741fc5f7fe1cac66de27303 (patch)
tree7f0b7cee663f4ddde269079d0d565ffbf39ec2a8 /builtin.c
parent0d52289482d468c8566976d77c0c6a6a4e602add (diff)
downloadegawk-b6ac928a53d146233741fc5f7fe1cac66de27303.tar.gz
egawk-b6ac928a53d146233741fc5f7fe1cac66de27303.tar.bz2
egawk-b6ac928a53d146233741fc5f7fe1cac66de27303.zip
Stop allocating an extra wasted byte at the end of various strings.
Diffstat (limited to 'builtin.c')
-rw-r--r--builtin.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/builtin.c b/builtin.c
index 21c6ed5c..838ab899 100644
--- a/builtin.c
+++ b/builtin.c
@@ -1833,7 +1833,7 @@ do_substr(int nargs)
* way to do things.
*/
memset(& mbs, 0, sizeof(mbs));
- emalloc(substr, char *, (length * gawk_mb_cur_max) + 2, "do_substr");
+ emalloc(substr, char *, (length * gawk_mb_cur_max) + 1, "do_substr");
wp = t1->wstptr + indx;
for (cp = substr; length > 0; length--) {
result = wcrtomb(cp, *wp, & mbs);