* elfxx-ia64.c (get_dyn_sym_info): Return NULL gracefully for
[binutils-gdb.git] / gas / hash.c
index f2e98a69e8b0409288211c309eccabc71c874311..df9101db6bec8cf83741cc06bd2ffb1cccf12c1d 100644 (file)
@@ -1,5 +1,6 @@
 /* hash.c -- gas hash table code
-   Copyright (C) 1987, 90, 91, 92, 93, 94, 95, 96, 98, 99, 2000
+   Copyright 1987, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1998, 1999,
+   2000, 2001, 2002
    Free Software Foundation, Inc.
 
    This file is part of GAS, the GNU Assembler.
@@ -29,6 +30,7 @@
    structure.  */
 
 #include "as.h"
+#include "safe-ctype.h"
 #include "obstack.h"
 
 /* The default number of entries to use when creating a hash table.  */
@@ -457,8 +459,7 @@ main ()
       printf ("hash_test command: ");
       gets (answer);
       command = answer[0];
-      if (isupper (command))
-       command = tolower (command);    /* Ecch!  */
+      command = TOLOWER (command);     /* Ecch!  */
       switch (command)
        {
        case '#':
@@ -545,19 +546,9 @@ char *
 what (description)
      char *description;
 {
-  char *retval;
-  char *malloc ();
-
   printf ("   %s : ", description);
   gets (answer);
-  /* Will one day clean up answer here.  */
-  retval = malloc (strlen (answer) + 1);
-  if (!retval)
-    {
-      error ("room");
-    }
-  (void) strcpy (retval, answer);
-  return (retval);
+  return xstrdup (answer);
 }
 
 void