summaryrefslogtreecommitdiff
path: root/libguile/symbols.c
diff options
context:
space:
mode:
Diffstat (limited to 'libguile/symbols.c')
-rw-r--r--libguile/symbols.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libguile/symbols.c b/libguile/symbols.c
index 6a463f914..83cddc0da 100644
--- a/libguile/symbols.c
+++ b/libguile/symbols.c
@@ -247,8 +247,8 @@ SCM_DEFINE (scm_gensym, "gensym", 0, 1, 0,
SCM_VALIDATE_STRING (1, prefix);
len = SCM_STRING_LENGTH (prefix);
if (len > MAX_PREFIX_LENGTH)
- name = SCM_MUST_MALLOC (MAX_PREFIX_LENGTH + SCM_INTBUFLEN);
- strncpy (name, SCM_STRING_CHARS (prefix), len);
+ name = SCM_MUST_MALLOC (len + SCM_INTBUFLEN);
+ memcpy (name, SCM_STRING_CHARS (prefix), len);
}
{
int n_digits = scm_iint2str (gensym_counter++, 10, &name[len]);