using NewStringNativeWithLength

This commit is contained in:
Brian Matzon 2007-04-19 22:21:04 +00:00
parent 3630ebd6c2
commit 4152deb7c4
2 changed files with 2 additions and 2 deletions

View File

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

View File

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