summaryrefslogtreecommitdiff
path: root/signame.c
diff options
context:
space:
mode:
authorPaul Smith <psmith@gnu.org>1999-02-19 18:07:49 +0000
committerPaul Smith <psmith@gnu.org>1999-02-19 18:07:49 +0000
commit84f38c9c6f56c7056a1d1a5abf9151bf15760151 (patch)
treee1b51c8fb565ac9c6e098e4d7bc932b43b93925d /signame.c
parent58085071441553b34ad1b06cd3f328bc15705383 (diff)
downloadgunmake-84f38c9c6f56c7056a1d1a5abf9151bf15760151.tar.gz
* Updates for automake 1.4 and autoconf 2.13
* Check for a libc version of GNU glob and, if found, don't use the local glob headers. * Fix a bug in OpenVMS archive handling. * Fix a bug in VMS siglist processing.
Diffstat (limited to 'signame.c')
-rw-r--r--signame.c20
1 files changed, 15 insertions, 5 deletions
diff --git a/signame.c b/signame.c
index ea02443..dd73723 100644
--- a/signame.c
+++ b/signame.c
@@ -70,12 +70,14 @@ extern char *sys_siglist[];
/* Table of abbreviations for signals. Note: A given number can
appear more than once with different abbreviations. */
+#define SIG_TABLE_SIZE (NSIG*2)
+
typedef struct
{
int number;
const char *abbrev;
} num_abbrev;
-static num_abbrev sig_table[NSIG*2];
+static num_abbrev sig_table[SIG_TABLE_SIZE];
/* Number of elements of sig_table used. */
static int sig_table_nelts = 0;
@@ -88,10 +90,18 @@ init_sig (number, abbrev, name)
const char *name;
{
#ifndef HAVE_SYS_SIGLIST
- sys_siglist[number] = name;
-#endif
- sig_table[sig_table_nelts].number = number;
- sig_table[sig_table_nelts++].abbrev = abbrev;
+ /* If this value is ever greater than NSIG it seems like it'd be a bug in
+ the system headers, but... better safe than sorry. We know, for
+ example, that this isn't always true on VMS. */
+
+ if (number >= 0 && number < NSIG)
+ sys_siglist[number] = name;
+#endif
+ if (sig_table_nelts < SIG_TABLE_SIZE)
+ {
+ sig_table[sig_table_nelts].number = number;
+ sig_table[sig_table_nelts++].abbrev = abbrev;
+ }
}
void