aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/decl.c
diff options
context:
space:
mode:
authorTobias Burnus <burnus@net-b.de>2007-11-24 01:11:38 +0100
committerTobias Burnus <burnus@gcc.gnu.org>2007-11-24 01:11:38 +0100
commitc5b5a17a923b67f3e3e4bbcef670b0b3d86198ab (patch)
tree93be568b96cbaa37715a85069eaaaf735c5843a8 /gcc/fortran/decl.c
parent88df9da15894541d19330b2f2d6cd301ce4f4cbf (diff)
downloadgcc-c5b5a17a923b67f3e3e4bbcef670b0b3d86198ab.zip
gcc-c5b5a17a923b67f3e3e4bbcef670b0b3d86198ab.tar.gz
gcc-c5b5a17a923b67f3e3e4bbcef670b0b3d86198ab.tar.bz2
re PR fortran/34187 (BIND(C): Public generic with private bind(c) specific does not use bind(C) name)
2007-11-23 Tobias Burnus <burnus@net-b.de> PR fortran/34187 * module.c (load_needed): Ensure binding_label is not lost. * decl.c (set_binding_label,gfc_match_bind_c): Replace strncpy by strcpy. 2007-11-23 Tobias Burnus <burnus@net-b.de> PR fortran/34187 * gfortran.dg/bind_c_usage_15.f90: New. From-SVN: r130386
Diffstat (limited to 'gcc/fortran/decl.c')
-rw-r--r--gcc/fortran/decl.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/gcc/fortran/decl.c b/gcc/fortran/decl.c
index 78b05c4..d66ea53 100644
--- a/gcc/fortran/decl.c
+++ b/gcc/fortran/decl.c
@@ -3126,15 +3126,14 @@ set_binding_label (char *dest_label, const char *sym_name, int num_idents)
if (curr_binding_label[0] != '\0')
{
/* Binding label given; store in temp holder til have sym. */
- strncpy (dest_label, curr_binding_label,
- strlen (curr_binding_label) + 1);
+ strcpy (dest_label, curr_binding_label);
}
else
{
/* No binding label given, and the NAME= specifier did not exist,
which means there was no NAME="". */
if (sym_name != NULL && has_name_equals == 0)
- strncpy (dest_label, sym_name, strlen (sym_name) + 1);
+ strcpy (dest_label, sym_name);
}
return SUCCESS;
@@ -4736,12 +4735,10 @@ gfc_match_bind_c (gfc_symbol *sym)
{
if (sym != NULL)
{
- strncpy (sym->binding_label, binding_label,
- strlen (binding_label)+1);
+ strcpy (sym->binding_label, binding_label);
}
else
- strncpy (curr_binding_label, binding_label,
- strlen (binding_label) + 1);
+ strcpy (curr_binding_label, binding_label);
}
else
{