summaryrefslogtreecommitdiff
path: root/gas/listing.c
diff options
context:
space:
mode:
authorH.J. Lu <hjl@lucon.org>2001-01-01 01:51:17 +0000
committerH.J. Lu <hjl@lucon.org>2001-01-01 01:51:17 +0000
commit97d5a691f575b4ed2e36ee3f08ebf3fc1e3e1472 (patch)
tree298df97f3e3ad307ffc6604573739af2b13a3148 /gas/listing.c
parenta04d9dc2b0367cb9f6b9ad10b97008de9e92aa47 (diff)
downloadbinutils-redhat-97d5a691f575b4ed2e36ee3f08ebf3fc1e3e1472.tar.gz
2000-12-31 H.J. Lu <hjl@gnu.org>
* listing.c (listing_message): Allocate string only if it is used. * configure: Rebuild.
Diffstat (limited to 'gas/listing.c')
-rw-r--r--gas/listing.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/gas/listing.c b/gas/listing.c
index 03dcfe8026..2c165dc13f 100644
--- a/gas/listing.c
+++ b/gas/listing.c
@@ -226,12 +226,12 @@ listing_message (name, message)
const char *name;
const char *message;
{
- unsigned int l = strlen (name) + strlen (message) + 1;
- char *n = (char *) xmalloc (l);
- strcpy (n, name);
- strcat (n, message);
if (listing_tail != (list_info_type *) NULL)
{
+ unsigned int l = strlen (name) + strlen (message) + 1;
+ char *n = (char *) xmalloc (l);
+ strcpy (n, name);
+ strcat (n, message);
listing_tail->message = n;
}
}