Skip to content

Commit

Permalink
Bug 915312 - Followup: Replace NULL with nullptr. r=glandium
Browse files Browse the repository at this point in the history
  • Loading branch information
mcomella committed Sep 23, 2014
1 parent 5a9f9e8 commit 6fe6f31
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions mozglue/android/NativeCrypto.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ extern "C" JNIEXPORT jbyteArray JNICALL Java_org_mozilla_gecko_background_native
if (dkLen < 0) {
env->ThrowNew(env->FindClass("java/lang/IllegalArgumentException"),
"dkLen should not be less than 0");
return NULL;
return nullptr;
}

jbyte *password = env->GetByteArrayElements(jpassword, NULL);
jbyte *password = env->GetByteArrayElements(jpassword, nullptr);
size_t passwordLen = env->GetArrayLength(jpassword);

jbyte *salt = env->GetByteArrayElements(jsalt, NULL);
jbyte *salt = env->GetByteArrayElements(jsalt, nullptr);
size_t saltLen = env->GetArrayLength(jsalt);

uint8_t hashResult[dkLen];
Expand All @@ -39,8 +39,8 @@ extern "C" JNIEXPORT jbyteArray JNICALL Java_org_mozilla_gecko_background_native
env->ReleaseByteArrayElements(jsalt, salt, JNI_ABORT);

jbyteArray out = env->NewByteArray(dkLen);
if (out == NULL) {
return NULL;
if (out == nullptr) {
return nullptr;
}
env->SetByteArrayRegion(out, 0, dkLen, (jbyte *) hashResult);

Expand All @@ -54,7 +54,7 @@ using namespace mozilla;
*/
extern "C" JNIEXPORT jbyteArray JNICALL Java_org_mozilla_gecko_background_nativecode_NativeCrypto_sha1
(JNIEnv *env, jclass jc, jbyteArray jstr) {
jbyte *str = env->GetByteArrayElements(jstr, NULL);
jbyte *str = env->GetByteArrayElements(jstr, nullptr);
size_t strLen = env->GetArrayLength(jstr);

SHA1Sum sha1;
Expand All @@ -65,8 +65,8 @@ extern "C" JNIEXPORT jbyteArray JNICALL Java_org_mozilla_gecko_background_native
env->ReleaseByteArrayElements(jstr, str, JNI_ABORT);

jbyteArray out = env->NewByteArray(SHA1Sum::kHashSize);
if (out == NULL) {
return NULL;
if (out == nullptr) {
return nullptr;
}
env->SetByteArrayRegion(out, 0, SHA1Sum::kHashSize, (jbyte *) hashResult);

Expand Down

0 comments on commit 6fe6f31

Please sign in to comment.