* section.c (bfd_get_section_contents): Put in parens to get
[deliverable/binutils-gdb.git] / bfd / format.c
index ad7bc81f6b4d16a2aee2626c0a201bb784770796..fb9fdc0d160c02e8851617f787a600df74023fa7 100644 (file)
@@ -1,5 +1,5 @@
 /* Generic BFD support for file formats.
-   Copyright (C) 1990-1991 Free Software Foundation, Inc.
+   Copyright (C) 1990, 91, 92, 93, 94 Free Software Foundation, Inc.
    Written by Cygnus Support.
 
 This file is part of BFD, the Binary File Descriptor library.
@@ -45,7 +45,7 @@ SECTION
 #include "libbfd.h"
 
 /* IMPORT from targets.c.  */
-extern CONST size_t bfd_default_vector_entries;
+extern CONST size_t _bfd_target_vector_entries;
 
 /*
 FUNCTION
@@ -141,8 +141,8 @@ bfd_check_format_matches (abfd, format, matching)
   if (matching)
     {
       *matching = matching_vector =
-       bfd_xmalloc_by_size_t (sizeof (char *) *
-                              (bfd_default_vector_entries + 1));
+       (char **) bfd_xmalloc_by_size_t (sizeof (char *) *
+                                        (_bfd_target_vector_entries + 1));
       matching_vector[0] = NULL;
     }
   right_targ = 0;
@@ -165,7 +165,7 @@ bfd_check_format_matches (abfd, format, matching)
     }
   }
 
-  for (target = target_vector; *target != NULL; target++) {
+  for (target = bfd_target_vector; *target != NULL; target++) {
     bfd_target *temp;
 
     abfd->xvec = *target;      /* Change BFD's target temporarily */
@@ -177,23 +177,23 @@ bfd_check_format_matches (abfd, format, matching)
     temp = BFD_SEND_FMT (abfd, _bfd_check_format, (abfd));
     if (temp) {                                /* This format checks out as ok! */
       right_targ = temp;
-      match_count++;
       if (matching)
        {
          matching_vector[match_count] = temp->name;
-         matching_vector[match_count] = NULL;
+         matching_vector[match_count + 1] = NULL;
        }
+      match_count++;
       /* If this is the default target, accept it, even if other targets
         might match.  People who want those other targets have to set 
         the GNUTARGET variable.  */
-      if (temp == default_vector[0])
+      if (temp == bfd_default_vector[0])
        {
-         match_count = 1;
          if (matching)
            {
              matching_vector[0] = temp->name;
              matching_vector[1] = NULL;
            }
+         match_count = 1;
          break;
        }
 #ifdef GNU960
This page took 0.025388 seconds and 4 git commands to generate.