[adb] Modernize codebase by replacing NULL with nullptr
Fixes -Wzero-as-null-pointer-constant warning.
Test: m
Bug: 68236239
Change-Id: Ia8c4deacafed2f3b7dbc3d4c3c77c6c632e3de81
diff --git a/adb/client/auth.cpp b/adb/client/auth.cpp
index 0f4dd33..5fbef09 100644
--- a/adb/client/auth.cpp
+++ b/adb/client/auth.cpp
@@ -109,7 +109,7 @@
LOG(INFO) << "generate_key(" << file << ")...";
mode_t old_mask;
- FILE *f = NULL;
+ FILE *f = nullptr;
int ret = 0;
EVP_PKEY* pkey = EVP_PKEY_new();
@@ -121,7 +121,7 @@
}
BN_set_word(exponent, RSA_F4);
- RSA_generate_key_ex(rsa, 2048, exponent, NULL);
+ RSA_generate_key_ex(rsa, 2048, exponent, nullptr);
EVP_PKEY_set1_RSA(pkey, rsa);
old_mask = umask(077);
@@ -135,7 +135,7 @@
umask(old_mask);
- if (!PEM_write_PrivateKey(f, pkey, NULL, NULL, 0, NULL, NULL)) {
+ if (!PEM_write_PrivateKey(f, pkey, nullptr, nullptr, 0, nullptr, nullptr)) {
D("Failed to write key");
goto out;
}
@@ -302,7 +302,7 @@
static std::string adb_auth_sign(RSA* key, const char* token, size_t token_size) {
if (token_size != TOKEN_SIZE) {
D("Unexpected token size %zd", token_size);
- return 0;
+ return nullptr;
}
std::string result;