Commit bdcb1a2c authored by Dr. Stephen Henson's avatar Dr. Stephen Henson
Browse files

more OSSL_NELEM cases



Reviewed-by: default avatarTim Hudson <tjh@openssl.org>
parent 59ef580a
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -2654,7 +2654,7 @@ int app_isdir(const char *name)
# if defined(UNICODE) || defined(_UNICODE)
    size_t i, len_0 = strlen(name) + 1;

    if (len_0 > sizeof(FileData.cFileName) / sizeof(FileData.cFileName[0]))
    if (len_0 > OSSL_NELEM(FileData.cFileName))
        return -1;

#  if !defined(_WIN32_WCE) || _WIN32_WCE>=101
+1 −1
Original line number Diff line number Diff line
@@ -2408,7 +2408,7 @@ static const char *crl_reasons[] = {
    "CAkeyTime"
};

#define NUM_REASONS (sizeof(crl_reasons) / sizeof(char *))
#define NUM_REASONS OSSL_NELEM(crl_reasons)

/*
 * Given revocation information convert to a DB string. The format of the
+1 −1
Original line number Diff line number Diff line
@@ -2438,7 +2438,7 @@ static void multiblock_speed(const EVP_CIPHER *evp_cipher)
{
    static int mblengths[] =
        { 8 * 1024, 2 * 8 * 1024, 4 * 8 * 1024, 8 * 8 * 1024, 8 * 16 * 1024 };
    int j, count, num = sizeof(lengths) / sizeof(lengths[0]);
    int j, count, num = OSSL_NELEM(lengths);
    const char *alg_name;
    unsigned char *inp, *out, no_key[32], no_iv[16];
    EVP_CIPHER_CTX ctx;
+2 −2
Original line number Diff line number Diff line
@@ -406,8 +406,8 @@ void OPENSSL_showfatal(const char *fmta, ...)
        } while (0);

    va_start(ap, fmta);
    _vsntprintf(buf, sizeof(buf) / sizeof(TCHAR) - 1, fmt, ap);
    buf[sizeof(buf) / sizeof(TCHAR) - 1] = _T('\0');
    _vsntprintf(buf, OSSL_NELEM(buf) - 1, fmt, ap);
    buf[OSSL_NELEM(buf) - 1] = _T('\0');
    va_end(ap);

# if defined(_WIN32_WINNT) && _WIN32_WINNT>=0x0333
+1 −1
Original line number Diff line number Diff line
@@ -131,4 +131,4 @@ static const X509V3_EXT_METHOD *standard_exts[] = {

/* Number of standard extensions */

#define STANDARD_EXTENSION_COUNT (sizeof(standard_exts)/sizeof(X509V3_EXT_METHOD *))
#define STANDARD_EXTENSION_COUNT OSSL_NELEM(standard_exts)
Loading