From 75328a34b6d2719184e43e9504faf994ed47befe Mon Sep 17 00:00:00 2001 From: Philippe Teuwen Date: Sun, 9 May 2021 23:37:34 +0200 Subject: [PATCH] arraylen --- armsrc/em4x70.c | 2 +- client/android/pm3_main.c | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/armsrc/em4x70.c b/armsrc/em4x70.c index 0ea6392d1..b1feb83b3 100644 --- a/armsrc/em4x70.c +++ b/armsrc/em4x70.c @@ -77,7 +77,7 @@ static int em4x70_receive(uint8_t *bits, size_t length); static bool find_listen_window(bool command); static void init_tag(void) { - memset(tag.data, 0x00, sizeof(tag.data) / sizeof(tag.data[0])); + memset(tag.data, 0x00, ARRAYLEN(tag.data)); } static void em4x70_setup_read(void) { diff --git a/client/android/pm3_main.c b/client/android/pm3_main.c index 1fb1cc95f..74019b0cd 100644 --- a/client/android/pm3_main.c +++ b/client/android/pm3_main.c @@ -25,6 +25,7 @@ #include "whereami.h" #include "comms.h" #include "fileutils.h" +#include "commonutil.h" // ARRAYLEN #include "jni_tools.h" //iceman, todo: proxify socker server name. Maybe set in preferences? @@ -151,13 +152,13 @@ JNIEXPORT jint JNI_OnLoad(JavaVM *vm, void *reserved) { {"closePm3", "()V", ClosePm3} }; - if ((*jniEnv)->RegisterNatives(jniEnv, clazz, methods, sizeof(methods) / sizeof(methods[0])) != + if ((*jniEnv)->RegisterNatives(jniEnv, clazz, methods, ARRAYLEN(methods)) != JNI_OK) { return -1; } if ((*jniEnv)->RegisterNatives(jniEnv, clz_test, methods1, - sizeof(methods1) / sizeof(methods1[0])) != JNI_OK) { + ARRAYLEN(methods1)) != JNI_OK) { return -1; }