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. */
+ if ((sig >= TARGET_SIGNAL_FIRST) && (sig <= TARGET_SIGNAL_LAST)
+ && signals[sig].name != NULL)
+ return signals[sig].name;
+ else
+ /* 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 "?";
- return signals[sig].name;
}
/* Given a name, return its signal. */