using NewStringNativeWithLength
This commit is contained in:
parent
3630ebd6c2
commit
4152deb7c4
|
@ -105,7 +105,7 @@ JNIEXPORT jstring JNICALL Java_org_lwjgl_WindowsSysImplementation_getClipboard
|
|||
CloseClipboard();
|
||||
return NULL;
|
||||
}
|
||||
ret = NewStringNative(env, (const char *) clipboard_data);
|
||||
ret = NewStringNativeWithLength(env, (const char *) clipboard_data, strlen(clipboard_data));
|
||||
} else {
|
||||
return NULL;
|
||||
}
|
||||
|
|
|
@ -93,7 +93,7 @@ static jstring queryRegistrationKey(JNIEnv *env, HKEY root_key, LPCTSTR subkey,
|
|||
return NULL;
|
||||
}
|
||||
result[buf_size - 1] = '\0';
|
||||
java_result = NewStringNative(env, result);
|
||||
java_result = NewStringNativeWithLength(env, result, strlen(result));
|
||||
free(result);
|
||||
return java_result;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue