From 084f3829ad65763ecb78bcd2e99d62f8307aaa54 Mon Sep 17 00:00:00 2001 From: Ben Noordhuis Date: Mon, 3 Nov 2014 12:15:52 +0100 Subject: [PATCH] src: clean up root_certs iteration Drop the trailing nullptr and use ARRAY_SIZE. --- src/node_crypto.cc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/node_crypto.cc b/src/node_crypto.cc index 90ec7e4f50..e4674a33be 100644 --- a/src/node_crypto.cc +++ b/src/node_crypto.cc @@ -112,7 +112,6 @@ static uv_rwlock_t* locks; const char* const root_certs[] = { #include "node_root_certs.h" // NOLINT(build/include_order) - nullptr }; X509_STORE* root_cert_store; @@ -670,7 +669,7 @@ void SecureContext::AddRootCerts(const FunctionCallbackInfo& args) { if (!root_cert_store) { root_cert_store = X509_STORE_new(); - for (int i = 0; root_certs[i]; i++) { + for (size_t i = 0; i < ARRAY_SIZE(root_certs); i++) { BIO* bp = NodeBIO::New(); if (!BIO_write(bp, root_certs[i], strlen(root_certs[i]))) {