From 5e70898cb4886858e0f91b27b22763a2929f57b1 Mon Sep 17 00:00:00 2001 From: Richard Stallman Date: Wed, 22 Sep 1993 20:21:03 +0000 Subject: [PATCH] (bc_strdup): Don't use strcpy's value. From-SVN: r5414 --- gcc/expr.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/gcc/expr.c b/gcc/expr.c index b3407bcde5f..48e95627665 100644 --- a/gcc/expr.c +++ b/gcc/expr.c @@ -9105,7 +9105,9 @@ static char * bc_strdup (s) char *s; { - return strcpy (xmalloc ((strlen (s) + 1) * sizeof *s), s); + char *new = (char *) xmalloc ((strlen (s) + 1) * sizeof *s); + strcpy (new, s); + return new; } -- 2.30.2