merge from gcc
[deliverable/binutils-gdb.git] / bfd / bfd.c
index 2c31e561fe53da6df90c2e0aaa43170a36f51bf4..2c5a42969a9377b1bf678a9e4072f6e5d6599014 100644 (file)
--- a/bfd/bfd.c
+++ b/bfd/bfd.c
@@ -8,7 +8,7 @@
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2 of the License, or
+   the Free Software Foundation; either version 3 of the License, or
    (at your option) any later version.
 
    This program is distributed in the hope that it will be useful,
@@ -18,7 +18,8 @@
 
    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
-   Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.  */
+   Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
+   MA 02110-1301, USA.  */
 
 /*
 SECTION
@@ -139,7 +140,7 @@ CODE_FRAGMENT
 .  {* Stuff only useful for archives.  *}
 .  void *arelt_data;
 .  struct bfd *my_archive;      {* The containing archive BFD.  *}
-.  struct bfd *next;            {* The next BFD in the archive.  *}
+.  struct bfd *archive_next;    {* The next BFD in the archive.  *}
 .  struct bfd *archive_head;    {* The first BFD in the archive.  *}
 .  bfd_boolean has_armap;
 .
@@ -202,10 +203,10 @@ CODE_FRAGMENT
 .
 */
 
-#include "bfd.h"
-#include "bfdver.h"
 #include "sysdep.h"
 #include <stdarg.h>
+#include "bfd.h"
+#include "bfdver.h"
 #include "libiberty.h"
 #include "demangle.h"
 #include "safe-ctype.h"
@@ -1773,12 +1774,12 @@ bfd_demangle (bfd *abfd, const char *name, int options)
        suf = res + len;
       suf_len = strlen (suf) + 1;
       final = bfd_malloc (pre_len + len + suf_len);
-      if (final == NULL)
-       return NULL;
-
-      memcpy (final, pre, pre_len);
-      memcpy (final + pre_len, res, len);
-      memcpy (final + pre_len + len, suf, suf_len);
+      if (final != NULL)
+       {
+         memcpy (final, pre, pre_len);
+         memcpy (final + pre_len, res, len);
+         memcpy (final + pre_len + len, suf, suf_len);
+       }
       free (res);
       res = final;
     }
This page took 0.024409 seconds and 4 git commands to generate.