Skip to content

Commit

Permalink
JNI cannot find \0 in strings on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
bear101 committed Oct 6, 2016
1 parent 55c2457 commit 1d0e260
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion TeamTalkJNI/jni/ttconvert-jni.h
Expand Up @@ -33,7 +33,7 @@
#define ZERO_STRUCT(s) memset(&s, 0, sizeof(s))

#if defined(WIN32)
#define NEW_JSTRING(env, str) (env->NewString(reinterpret_cast<const jchar*>(str), TT_STRLEN))
#define NEW_JSTRING(env, str) (env->NewString(reinterpret_cast<const jchar*>(str), wcslen(str)))
#define TT_STRCPY(dst, src) do { wcsncpy(dst, src, TT_STRLEN); dst[TT_STRLEN-1]; } while(0)
const jint* TO_JINT_ARRAY(const INT32* ttints, jint* jints, INT32 N);
#else
Expand Down

0 comments on commit 1d0e260

Please sign in to comment.