projects
/
deliverable
/
binutils-gdb.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
use xstrdup, xmemdup0 and concat more
[deliverable/binutils-gdb.git]
/
gas
/
config
/
obj-evax.c
diff --git
a/gas/config/obj-evax.c
b/gas/config/obj-evax.c
index e36859209113637703b6e29d7435ed132334fa41..445828697a3a3a6e156d75d3a1eda08cb4546cf2 100644
(file)
--- a/
gas/config/obj-evax.c
+++ b/
gas/config/obj-evax.c
@@
-273,9
+273,7
@@
evax_shorten_name (char *id)
}
/* We only need worry about krunching the base symbol. */
}
/* We only need worry about krunching the base symbol. */
- base_id = xmalloc (suffix_dotdot - prefix_dotdot + 1);
- strncpy (base_id, &id[prefix_dotdot], suffix_dotdot - prefix_dotdot);
- base_id [suffix_dotdot - prefix_dotdot] = 0;
+ base_id = xmemdup0 (&id[prefix_dotdot], suffix_dotdot - prefix_dotdot);
if (strlen (base_id) > MAX_LABEL_LENGTH)
{
if (strlen (base_id) > MAX_LABEL_LENGTH)
{
@@
-299,8
+297,7
@@
evax_shorten_name (char *id)
strcat (new_id, suffix);
/* Save it on the heap and return. */
strcat (new_id, suffix);
/* Save it on the heap and return. */
- return_id = xmalloc (strlen (new_id) + 1);
- strcpy (return_id, new_id);
+ return_id = xstrdup (new_id);
return return_id;
}
return return_id;
}
This page took
0.026135 seconds
and
4
git commands to generate.