diff options
author | wtc%netscape.com <devnull@localhost> | 2001-06-06 17:00:51 +0000 |
---|---|---|
committer | wtc%netscape.com <devnull@localhost> | 2001-06-06 17:00:51 +0000 |
commit | 2db4038b198dcae95cc61eed1d1a7eceeada8078 (patch) | |
tree | ef7016fb33587979393c372732d020f278143081 | |
parent | 168e0f6c076b984d538c86299de360d3e751cee2 (diff) | |
download | nss-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.
-rw-r--r-- | security/nss/cmd/modutil/pk11.c | 9 |
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]); /*********************************************************************** * |