Delete temporary string within demangler even in failure cases.
[deliverable/binutils-gdb.git] / libiberty / strndup.c
index b7647777bc5987680765cec14470b093ae51571f..9e9b4e2991f833082acd176f48825f76d5a888b9 100644 (file)
@@ -15,8 +15,8 @@ Library General Public License for more details.
 
 You should have received a copy of the GNU Library General Public
 License along with libiberty; see the file COPYING.LIB.  If
-not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA.  */
+not, write to the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor,
+Boston, MA 02110-1301, USA.  */
 
 /*
 
@@ -46,10 +46,10 @@ strndup (const char *s, size_t n)
   if (n < len)
     len = n;
 
-  result = malloc (len + 1);
+  result = (char *) malloc (len + 1);
   if (!result)
     return 0;
 
   result[len] = '\0';
-  return memcpy (result, s, len);
+  return (char *) memcpy (result, s, len);
 }
This page took 0.022766 seconds and 4 git commands to generate.