diff options
author | detailer | 2021-05-11 17:39:34 +0530 |
---|---|---|
committer | detailer | 2021-05-11 17:39:34 +0530 |
commit | 59e714eba002aeb7c3ceb9bceda601a7c4b6b5ae (patch) | |
tree | 4ce39de9a27364ce5bd63822487f90fb737726b4 /sci_gateway | |
parent | 89459fb1b9b44d9e0acb35bf256b482828055d5f (diff) | |
download | fossee-scilab-octave-toolbox-59e714eba002aeb7c3ceb9bceda601a7c4b6b5ae.tar.gz fossee-scilab-octave-toolbox-59e714eba002aeb7c3ceb9bceda601a7c4b6b5ae.tar.bz2 fossee-scilab-octave-toolbox-59e714eba002aeb7c3ceb9bceda601a7c4b6b5ae.zip |
malloc size fix for I/P struct key
Diffstat (limited to 'sci_gateway')
-rw-r--r-- | sci_gateway/cpp/sci_octave.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sci_gateway/cpp/sci_octave.cpp b/sci_gateway/cpp/sci_octave.cpp index 377506a..1a23000 100644 --- a/sci_gateway/cpp/sci_octave.cpp +++ b/sci_gateway/cpp/sci_octave.cpp @@ -170,7 +170,7 @@ extern "C" for (j = 0; j < dims; j++) { // storing the key - inStruct[j].key = malloc(sizeof(keys[j]) + 1); + inStruct[j].key = malloc(sizeof(wchar_t) * (wcslen(keys[j]) + 1)); wcpcpy((wchar_t*) inStruct[j].key, keys[j]); struct_out = scilab_getStructMatrix2dData(env, in[i], keys[j], 0, 0); // Retrieving Curr Value |