Skip to content

Commit 67be602

Browse files
committed
sync JNI code
1 parent e96b8b7 commit 67be602

File tree

1 file changed

+33
-3
lines changed

1 file changed

+33
-3
lines changed

jni-c-toxcore/jni-c-toxcore.c

Lines changed: 33 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,9 +84,9 @@
8484
// ----------- version -----------
8585
#define VERSION_MAJOR 0
8686
#define VERSION_MINOR 99
87-
#define VERSION_PATCH 95
88-
static const char global_version_string[] = "0.99.95";
89-
static const char global_version_asan_string[] = "0.99.95-ASAN";
87+
#define VERSION_PATCH 96
88+
static const char global_version_string[] = "0.99.96";
89+
static const char global_version_asan_string[] = "0.99.96-ASAN";
9090
// ----------- version -----------
9191
// ----------- version -----------
9292

@@ -3128,6 +3128,21 @@ int add_tcp_relay_single(Tox *tox, const char *ip, uint16_t port, const char *ke
31283128
int Java_com_zoffcc_applications_trifa_MainActivity_add_1tcp_1relay_1single__real(JNIEnv *env, jobject thiz, jstring ip,
31293129
jstring key_hex, long port)
31303130
{
3131+
if (ip == NULL)
3132+
{
3133+
return 1;
3134+
}
3135+
3136+
if (key_hex == NULL)
3137+
{
3138+
return 1;
3139+
}
3140+
3141+
if (tox_global == NULL)
3142+
{
3143+
return 1;
3144+
}
3145+
31313146
// dbg(9, "add_tcp_relay_single1");
31323147
const char *key_hex_str = NULL;
31333148
const char *ip_str = NULL;
@@ -3202,6 +3217,21 @@ int Java_com_zoffcc_applications_trifa_MainActivity_bootstrap_1single__real(JNIE
32023217
jobject key_hex, long port)
32033218
{
32043219
// dbg(9, "bootstrap_single");
3220+
if (ip == NULL)
3221+
{
3222+
return 1;
3223+
}
3224+
3225+
if (key_hex == NULL)
3226+
{
3227+
return 1;
3228+
}
3229+
3230+
if (tox_global == NULL)
3231+
{
3232+
return 1;
3233+
}
3234+
32053235
const char *ip_str = (*env)->GetStringUTFChars(env, ip, NULL);
32063236
const char *key_hex_str = (*env)->GetStringUTFChars(env, key_hex, NULL);
32073237
int res = bootstrap_single(tox_global, ip_str, (uint16_t)port, key_hex_str);

0 commit comments

Comments
 (0)