From: <eli...@us...> - 2008-04-25 17:22:04
|
Revision: 3046 http://java-game-lib.svn.sourceforge.net/java-game-lib/?rev=3046&view=rev Author: elias_naur Date: 2008-04-25 10:21:59 -0700 (Fri, 25 Apr 2008) Log Message: ----------- NewStringNativeUnsigned should return NULL if argument string is NULL Modified Paths: -------------- trunk/LWJGL/src/native/common/common_tools.c Modified: trunk/LWJGL/src/native/common/common_tools.c =================================================================== --- trunk/LWJGL/src/native/common/common_tools.c 2008-04-25 02:18:27 UTC (rev 3045) +++ trunk/LWJGL/src/native/common/common_tools.c 2008-04-25 17:21:59 UTC (rev 3046) @@ -201,8 +201,11 @@ /* creates locale specific string, unsigned argument to * match GLuchar and ALuchar types */ -jstring NewStringNativeUnsigned(JNIEnv *env, const unsigned char *str) { - return NewStringNativeWithLength(env, (const char *)str, strlen((const char *)str)); +jstring NewStringNativeUnsigned(JNIEnv *env, const unsigned char *ustr) { + const char *str = (const char *)ustr; + if (str == NULL) + return NULL; + return NewStringNativeWithLength(env, str, strlen(str)); } // creates locale specific string This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |