Skip to content

Commit

Permalink
Appease GCC 8 string diagnostics
Browse files Browse the repository at this point in the history
  • Loading branch information
jryans committed Aug 7, 2019
1 parent f7c99ea commit cef63f8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions binutils/objcopy.c
Original file line number Diff line number Diff line change
Expand Up @@ -1932,11 +1932,11 @@ unbind_list_append (const char *cause, const char *sym)
new_node->sym = strdup (sym);

new_node->def_name = xmalloc (sizeof def_prefix + sym_len);
strncpy(new_node->def_name, def_prefix, sizeof def_prefix - 1);
strncpy(new_node->def_name, def_prefix, sizeof new_node->def_name - 1);
strncpy(new_node->def_name + sizeof def_prefix - 1, sym, sym_len + 1);

new_node->ref_name = xmalloc (sizeof ref_prefix + strlen(sym));
strncpy(new_node->ref_name, ref_prefix, sizeof ref_prefix - 1);
strncpy(new_node->ref_name, ref_prefix, sizeof new_node->ref_name - 1);
strncpy(new_node->ref_name + sizeof ref_prefix - 1, sym, sym_len + 1);

new_node->next = NULL;
Expand Down

0 comments on commit cef63f8

Please sign in to comment.