libwg-go: fix style
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
This commit is contained in:
parent
858ec4c0ab
commit
b7e025e381
@ -49,11 +49,11 @@ JNIEXPORT jint JNICALL Java_com_wireguard_android_backend_GoBackend_wgGetSocketV
|
|||||||
|
|
||||||
JNIEXPORT jstring JNICALL Java_com_wireguard_android_backend_GoBackend_wgVersion(JNIEnv *env, jclass c)
|
JNIEXPORT jstring JNICALL Java_com_wireguard_android_backend_GoBackend_wgVersion(JNIEnv *env, jclass c)
|
||||||
{
|
{
|
||||||
|
jstring ret;
|
||||||
struct go_string s = wgVersion();
|
struct go_string s = wgVersion();
|
||||||
char *cstr = malloc(s.n + 1);
|
char *cstr = malloc(s.n + 1);
|
||||||
if (!cstr)
|
if (!cstr)
|
||||||
return NULL;
|
return NULL;
|
||||||
jstring ret;
|
|
||||||
memcpy(cstr, s.str, s.n);
|
memcpy(cstr, s.str, s.n);
|
||||||
cstr[s.n] = '\0';
|
cstr[s.n] = '\0';
|
||||||
ret = (*env)->NewStringUTF(env, cstr);
|
ret = (*env)->NewStringUTF(env, cstr);
|
||||||
|
Loading…
Reference in New Issue
Block a user