diff options
| author | J08nY | 2019-07-16 11:44:17 +0200 |
|---|---|---|
| committer | J08nY | 2019-07-16 11:44:17 +0200 |
| commit | e0a4956cafcbb98bdf18c9a25fbf799e4de4a35e (patch) | |
| tree | 9803e4d0af26639d972bdeda06f935e051db8350 /src/cz/crcs/ectester/standalone/libs/jni/c_utils.c | |
| parent | 46c0a874e494d2311148700058f61b5d8d426f3c (diff) | |
| download | ECTester-e0a4956cafcbb98bdf18c9a25fbf799e4de4a35e.tar.gz ECTester-e0a4956cafcbb98bdf18c9a25fbf799e4de4a35e.tar.zst ECTester-e0a4956cafcbb98bdf18c9a25fbf799e4de4a35e.zip | |
Diffstat (limited to 'src/cz/crcs/ectester/standalone/libs/jni/c_utils.c')
| -rw-r--r-- | src/cz/crcs/ectester/standalone/libs/jni/c_utils.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/cz/crcs/ectester/standalone/libs/jni/c_utils.c b/src/cz/crcs/ectester/standalone/libs/jni/c_utils.c index a5bc14d..46286fd 100644 --- a/src/cz/crcs/ectester/standalone/libs/jni/c_utils.c +++ b/src/cz/crcs/ectester/standalone/libs/jni/c_utils.c @@ -3,6 +3,10 @@ #include <string.h> #include <stdlib.h> +#if defined(__WIN32__) || defined(_MSC_VER) +#include <windows.h> +#endif + jclass ec_parameter_spec_class; jclass ecgen_parameter_spec_class; jclass secret_key_spec_class; @@ -228,7 +232,11 @@ char *biginteger_to_hex(JNIEnv *env, jobject big, jint bytes) { jstring big_string = (*env)->CallObjectMethod(env, big, to_string, (jint) 16); jsize len = (*env)->GetStringUTFLength(env, big_string); +#if defined(__WIN32__) || defined(_MSC_VER) + char *raw_string = _alloca(len); +#else char raw_string[len]; +#endif (*env)->GetStringUTFRegion(env, big_string, 0, len, raw_string); char *result = calloc(bytes, 2); |
