libwg-go: fix style

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
This commit is contained in:
Jason A. Donenfeld 2018-06-01 18:27:30 +02:00
parent 858ec4c0ab
commit b7e025e381

View File

@ -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);