summaryrefslogtreecommitdiff
path: root/security/nss/cmd/modutil
diff options
context:
space:
mode:
authorwtc%netscape.com <devnull@localhost>2001-06-06 17:00:51 +0000
committerwtc%netscape.com <devnull@localhost>2001-06-06 17:00:51 +0000
commit2db4038b198dcae95cc61eed1d1a7eceeada8078 (patch)
treeef7016fb33587979393c372732d020f278143081 /security/nss/cmd/modutil
parent168e0f6c076b984d538c86299de360d3e751cee2 (diff)
downloadnss-hg-2db4038b198dcae95cc61eed1d1a7eceeada8078.tar.gz
Bugzilla bug #77884: fixed discrepancy between the size of an array and
the variable that represents the array size. Let the compiler compute the value for us instead of using hardcoded constants. Thanks to andrew@fernandes.org for reporting and tracking down this bug.
Diffstat (limited to 'security/nss/cmd/modutil')
-rw-r--r--security/nss/cmd/modutil/pk11.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/security/nss/cmd/modutil/pk11.c b/security/nss/cmd/modutil/pk11.c
index ce922424c..6081cdcd7 100644
--- a/security/nss/cmd/modutil/pk11.c
+++ b/security/nss/cmd/modutil/pk11.c
@@ -116,12 +116,14 @@ static MaskString mechanismStrings[] = {
{"RANDOM", PUBLIC_MECH_RANDOM_FLAG},
{"FRIENDLY", PUBLIC_MECH_FRIENDLY_FLAG}
};
-static int numMechanismStrings = 13;
+static int numMechanismStrings =
+ sizeof(mechanismStrings) / sizeof(mechanismStrings[0]);
static MaskString cipherStrings[] = {
{"FORTEZZA", PUBLIC_CIPHER_FORTEZZA_FLAG}
};
-static int numCipherStrings= 1;
+static int numCipherStrings =
+ sizeof(cipherStrings) / sizeof(cipherStrings[0]);
/* Maximum length of a colon-separated list of all the strings in an
* array. */
@@ -355,7 +357,6 @@ loser:
}
/* Strings describing PK11DisableReasons */
-static int numDisableReasonStr = 5;
static char *disableReasonStr[] = {
"no reason",
"user disabled",
@@ -363,6 +364,8 @@ static char *disableReasonStr[] = {
"could not verify token",
"token not present"
};
+static int numDisableReasonStr =
+ sizeof(disableReasonStr) / sizeof(disableReasonStr[0]);
/***********************************************************************
*