summaryrefslogtreecommitdiff
path: root/gas/sb.c
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2012-06-09 13:21:59 +0000
committerH.J. Lu <hjl.tools@gmail.com>2012-06-09 13:21:59 +0000
commit89b5ea1131cdaec3aab07f5e8574c6148288f16d (patch)
treec0e774eb8e5c054072f7767b74df54d47a286de7 /gas/sb.c
parentcb23c38305855e1502d1c0099ac9d9d0b7f6277b (diff)
downloadbinutils-redhat-89b5ea1131cdaec3aab07f5e8574c6148288f16d.tar.gz
Allocate sufficient space for string buffer
* input-scrub.c (input_scrub_include_sb): Use sb_build to allocate sufficient space for from_sb. Use sb_terminate to terminate string. * read.c (read_a_source_file): Use sb_build to allocate sufficient space and replace sb_add_string with sb_add_buffer. (s_macro): Likewise. (input_scrub_insert_line): Likewise. (s_irp): Use sb_build to allocate sufficient space. (do_repeat): Use sb_build to allocate sufficient space for many. * sb.c (sb_build): Remove static. * sb.h (sb_build): New prototype.
Diffstat (limited to 'gas/sb.c')
-rw-r--r--gas/sb.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/gas/sb.c b/gas/sb.c
index 73fd10c6c5..f68402fc47 100644
--- a/gas/sb.c
+++ b/gas/sb.c
@@ -57,7 +57,7 @@ static void sb_check (sb *, size_t);
/* Initializes an sb. */
-static void
+void
sb_build (sb *ptr, size_t size)
{
ptr->ptr = xmalloc (size + 1);