From 9780df22f1dc5c8e9969ad813e015e8936122824 Mon Sep 17 00:00:00 2001 From: Daniel C Date: Sat, 2 Nov 2024 15:51:44 -0400 Subject: [PATCH] crappy typo --- ndk/settings.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/ndk/settings.c b/ndk/settings.c index 3ef6f40..50e83ef 100644 --- a/ndk/settings.c +++ b/ndk/settings.c @@ -45,11 +45,15 @@ char *app_get_wpa2_password(void) { free(s); return strdup(""); } + return s; } SETTINGS_FUNC(jobject, getWPA2Password)(JNIEnv *env, jclass thiz, jobject ctx) { set_jni_env_ctx(env, ctx); - return (*env)->NewStringUTF(env, app_get_wpa2_password()); + char *x = app_get_wpa2_password(); + jstring js = (*env)->NewStringUTF(env, x); + free(x); + return js; } static void input_handler(const char *view_id, const char *setting_id) { @@ -82,11 +86,11 @@ SETTINGS_FUNC(void, handleSettingsButtons)(JNIEnv *env, jobject thiz, jobject ct // view_set_checked(env, view, x); view = view_get_by_id(env, ctx, "ip_address_text"); - view_add_native_input_listener(env, view, (void *) input_handler, 2, "ip_address_text", "ip_address"); + view_add_native_input_listener(env, view, (void *)input_handler, 2, "ip_address_text", "ip_address"); view_set_text(env, view, app_get_camera_ip()); view = view_get_by_id(env, ctx, "wpa_password"); - view_add_native_input_listener(env, view, (void *) input_handler, 2, "wpa_password", "wpa_password"); + view_add_native_input_listener(env, view, (void *)input_handler, 2, "wpa_password", "wpa_password"); view_set_text(env, view, app_get_wpa2_password()); view = view_get_by_id(env, ctx, "client_name");