Skip to content

Commit

Permalink
src: clean up root_certs iteration
Browse files Browse the repository at this point in the history
Drop the trailing nullptr and use ARRAY_SIZE.
  • Loading branch information
bnoordhuis committed Nov 3, 2014
1 parent 29d7fd6 commit 084f382
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/node_crypto.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -670,7 +669,7 @@ void SecureContext::AddRootCerts(const FunctionCallbackInfo<Value>& 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]))) {
Expand Down

0 comments on commit 084f382

Please sign in to comment.