about summary refs log tree commit diff
path: root/manual
diff options
context:
space:
mode:
Diffstat (limited to 'manual')
-rw-r--r--manual/memory.texi6
1 files changed, 3 insertions, 3 deletions
diff --git a/manual/memory.texi b/manual/memory.texi
index bd1a9a5401..9ebe31e920 100644
--- a/manual/memory.texi
+++ b/manual/memory.texi
@@ -905,9 +905,9 @@ struct obstack string_obstack;
 char *
 copystring (char *string)
 @{
-  char *s = (char *) obstack_alloc (&string_obstack,
-                                    strlen (string) + 1);
-  memcpy (s, string, strlen (string));
+  size_t len = strlen (string) + 1;
+  char *s = (char *) obstack_alloc (&string_obstack, len);
+  memcpy (s, string, len);
   return s;
 @}
 @end smallexample