Rewrite target_signal_to_name().

This commit is contained in:
Andrew Cagney 2002-01-13 21:58:16 +00:00
parent 89c49e7acb
commit ade8f45eaf
2 changed files with 10 additions and 6 deletions

View file

@ -1,3 +1,8 @@
2002-01-13 Andrew Cagney <ac131313@redhat.com>
* signals.c (target_signal_to_name): Rewrite. Only use
signals[].name when in bounds and non-NULL.
2002-01-13 Andrew Cagney <ac131313@redhat.com>
From Petr Ledvina <ledvinap@kae.zcu.cz>:

View file

@ -210,14 +210,13 @@ target_signal_to_string (enum target_signal sig)
char *
target_signal_to_name (enum target_signal sig)
{
if (sig == TARGET_SIGNAL_UNKNOWN)
/* I think the code which prints this will always print it along with
the string, so no need to be verbose. */
return "?";
else if ((sig >= TARGET_SIGNAL_FIRST) && (sig <= TARGET_SIGNAL_LAST))
if ((sig >= TARGET_SIGNAL_FIRST) && (sig <= TARGET_SIGNAL_LAST)
&& signals[sig].name != NULL)
return signals[sig].name;
else
return signals[sig].name;
/* I think the code which prints this will always print it along
with the string, so no need to be verbose (very old comment). */
return "?";
}
/* Given a name, return its signal. */