aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/string.c
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2009-05-26 17:39:25 -0700
committerRuss Cox <rsc@golang.org>2009-05-26 17:39:25 -0700
commit1a0a6f9d5004d0ae078d7772e9623f9f6117f9be (patch)
treecda077207c6ae3ee181895b0409d07d9be1adc37 /src/runtime/string.c
parent7d73075511d824177127ba71248013387769c059 (diff)
downloadgo-1a0a6f9d5004d0ae078d7772e9623f9f6117f9be.tar.xz
add NUL when allocating strings, to make use
of getenv by low-level runtime easier. fix 32-bit bug in gc (there are still more). R=ken OCL=29415 CL=29415
Diffstat (limited to 'src/runtime/string.c')
-rw-r--r--src/runtime/string.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/runtime/string.c b/src/runtime/string.c
index 5e4922a99f..d7393ef6ed 100644
--- a/src/runtime/string.c
+++ b/src/runtime/string.c
@@ -27,7 +27,7 @@ gostringsize(int32 l)
if(l == 0)
return emptystring;
- s.str = mal(l);
+ s.str = mal(l+1); // leave room for NUL for C runtime (e.g., callers of getenv)
s.len = l;
if(l > maxstring)
maxstring = l;