aboutsummaryrefslogtreecommitdiff
path: root/gcc/cppalloc.c
diff options
context:
space:
mode:
authorZack Weinberg <zack@gcc.gnu.org>1999-09-11 05:38:06 +0000
committerZack Weinberg <zack@gcc.gnu.org>1999-09-11 05:38:06 +0000
commit6ee2c979428ff9f8e2abc37f42f63380cff632ed (patch)
tree52c46696ab752bb46fd99b5d07c89df8ea0e819d /gcc/cppalloc.c
parent27e934d8bae03ea7eddeb3770641440333a71478 (diff)
downloadgcc-6ee2c979428ff9f8e2abc37f42f63380cff632ed.zip
gcc-6ee2c979428ff9f8e2abc37f42f63380cff632ed.tar.gz
gcc-6ee2c979428ff9f8e2abc37f42f63380cff632ed.tar.bz2
cppalloc.c (xstrdup): Use memcpy.
1999-09-10 22:37 -0700 Zack Weinberg <zack@bitmover.com> * cppalloc.c (xstrdup): Use memcpy. * cpperror.c (cpp_print_containing_files): Don't use cpp_notice. * cpplib.c (conditional_skip): Set temp->lineno. (do_endif): Make error message less obscure. (if_directive_name): New function. (cpp_get_token [case EOF]): Unwind the if stack and generate error messages for each unterminated conditional in this file. (parse_string): Do not behave differently if -traditional. From-SVN: r29279
Diffstat (limited to 'gcc/cppalloc.c')
-rw-r--r--gcc/cppalloc.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/gcc/cppalloc.c b/gcc/cppalloc.c
index b42e523..47712e7 100644
--- a/gcc/cppalloc.c
+++ b/gcc/cppalloc.c
@@ -74,8 +74,8 @@ char *
xstrdup (input)
const char *input;
{
- unsigned size = strlen (input);
- char *output = xmalloc (size + 1);
- strcpy (output, input);
+ size_t size = strlen (input) + 1;
+ char *output = xmalloc (size);
+ memcpy (output, input, size);
return output;
}