From 1a78ef4c0e265918c66828dc4cc479c0539ec225 Mon Sep 17 00:00:00 2001 From: Uros Bizjak Date: Sun, 4 Jan 2015 16:35:57 +0100 Subject: [PATCH] misc.c (internal_error_function): Use xasprintf instead of unchecked asprintf. * gcc-interface/misc.c (internal_error_function): Use xasprintf instead of unchecked asprintf. From-SVN: r219175 --- gcc/ada/ChangeLog | 5 +++++ gcc/ada/gcc-interface/misc.c | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index a8eba2941f2..dadaa2520a8 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,8 @@ +2015-01-04 Uros Bizjak + + * gcc-interface/misc.c (internal_error_function): Use xasprintf instead + of unchecked asprintf. + 2014-12-22 Eric Botcazou * gcc-interface/trans.c (Attribute_to_gnu) : If the diff --git a/gcc/ada/gcc-interface/misc.c b/gcc/ada/gcc-interface/misc.c index 14c58da4c02..7e5b8d90b0a 100644 --- a/gcc/ada/gcc-interface/misc.c +++ b/gcc/ada/gcc-interface/misc.c @@ -326,9 +326,9 @@ internal_error_function (diagnostic_context *context, xloc = expand_location (input_location); if (context->show_column && xloc.column != 0) - asprintf (&loc, "%s:%d:%d", xloc.file, xloc.line, xloc.column); + loc = xasprintf ("%s:%d:%d", xloc.file, xloc.line, xloc.column); else - asprintf (&loc, "%s:%d", xloc.file, xloc.line); + loc = xasprintf ("%s:%d", xloc.file, xloc.line); temp_loc.Low_Bound = 1; temp_loc.High_Bound = strlen (loc); sp_loc.Bounds = &temp_loc; -- 2.30.2