]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blobdiff - binutils/nlmconv.c
top level:
[thirdparty/binutils-gdb.git] / binutils / nlmconv.c
index 551e7e59e430bbbfacef4d2f3f502937734625dd..1d477086a8eea5001f525f67b15f5695fab94e6a 100644 (file)
@@ -1,6 +1,6 @@
 /* nlmconv.c -- NLM conversion program
    Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-   2003, 2004, 2005 Free Software Foundation, Inc.
+   2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
 
    This file is part of GNU Binutils.
 
@@ -737,7 +737,7 @@ main (int argc, char **argv)
              || ! bfd_set_section_flags (outbfd, help_section,
                                          SEC_HAS_CONTENTS))
            bfd_fatal (_("help section"));
-         strncpy (nlm_extended_header (outbfd)->stamp, "MeSsAgEs", 8);
+         LITMEMCPY (nlm_extended_header (outbfd)->stamp, "MeSsAgEs");
        }
     }
   if (message_file != NULL)
@@ -759,7 +759,7 @@ main (int argc, char **argv)
              || ! bfd_set_section_flags (outbfd, message_section,
                                          SEC_HAS_CONTENTS))
            bfd_fatal (_("message section"));
-         strncpy (nlm_extended_header (outbfd)->stamp, "MeSsAgEs", 8);
+         LITMEMCPY (nlm_extended_header (outbfd)->stamp, "MeSsAgEs");
        }
     }
   if (modules != NULL)
@@ -795,7 +795,7 @@ main (int argc, char **argv)
              || ! bfd_set_section_flags (outbfd, rpc_section,
                                          SEC_HAS_CONTENTS))
            bfd_fatal (_("rpc section"));
-         strncpy (nlm_extended_header (outbfd)->stamp, "MeSsAgEs", 8);
+         LITMEMCPY (nlm_extended_header (outbfd)->stamp, "MeSsAgEs");
        }
     }
   if (sharelib_file != NULL)
@@ -852,20 +852,20 @@ main (int argc, char **argv)
                  || ! bfd_set_section_flags (outbfd, shared_section,
                                              SEC_HAS_CONTENTS))
                bfd_fatal (_("shared section"));
-             strncpy (nlm_extended_header (outbfd)->stamp, "MeSsAgEs", 8);
+             LITMEMCPY (nlm_extended_header (outbfd)->stamp, "MeSsAgEs");
            }
        }
     }
 
   /* Check whether a version was given.  */
-  if (strncmp (version_hdr->stamp, "VeRsIoN#", 8) != 0)
+  if (!CONST_STRNEQ (version_hdr->stamp, "VeRsIoN#"))
     non_fatal (_("warning: No version number given"));
 
   /* At least for now, always create an extended header, because that
      is what NLMLINK does.  */
-  strncpy (nlm_extended_header (outbfd)->stamp, "MeSsAgEs", 8);
+  LITMEMCPY (nlm_extended_header (outbfd)->stamp, "MeSsAgEs");
 
-  strncpy (nlm_cygnus_ext_header (outbfd)->stamp, "CyGnUsEx", 8);
+  LITMEMCPY (nlm_cygnus_ext_header (outbfd)->stamp, "CyGnUsEx");
 
   /* If the date was not given, force it in.  */
   if (nlm_version_header (outbfd)->month == 0
@@ -880,7 +880,7 @@ main (int argc, char **argv)
       nlm_version_header (outbfd)->month = ptm->tm_mon + 1;
       nlm_version_header (outbfd)->day = ptm->tm_mday;
       nlm_version_header (outbfd)->year = ptm->tm_year + 1900;
-      strncpy (version_hdr->stamp, "VeRsIoN#", 8);
+      LITMEMCPY (version_hdr->stamp, "VeRsIoN#");
     }
 
 #ifdef NLMCONV_POWERPC
@@ -1109,7 +1109,7 @@ show_usage (FILE *file, int status)
   -h --help                     Display this information\n\
   -v --version                  Display the program's version\n\
 "));
-  if (status == 0)
+  if (REPORT_BUGS_TO[0] && status == 0)
     fprintf (file, _("Report bugs to %s\n"), REPORT_BUGS_TO);
   exit (status);
 }
@@ -1747,9 +1747,9 @@ powerpc_build_stubs (bfd *inbfd, bfd *outbfd ATTRIBUTE_UNUSED,
 
       /* Make a new undefined symbol with the same name but without
         the leading `.'.  */
-      newsym = (asymbol *) xmalloc (sizeof (asymbol));
+      newsym = xmalloc (sizeof (asymbol));
       *newsym = *sym;
-      newname = (char *) xmalloc (strlen (bfd_asymbol_name (sym)));
+      newname = xmalloc (strlen (bfd_asymbol_name (sym)));
       strcpy (newname, bfd_asymbol_name (sym) + 1);
       newsym->name = newname;