From c9802ab049d67e3f4260b75d06e6dc244e877100 Mon Sep 17 00:00:00 2001 From: Alexander Date: Tue, 21 Dec 2021 23:31:46 +0300 Subject: [PATCH] Fix returning string variables --- src/natives.cpp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/natives.cpp b/src/natives.cpp index 056d57f..1cf471a 100644 --- a/src/natives.cpp +++ b/src/natives.cpp @@ -209,7 +209,7 @@ namespace sampnode case 'S': { - unsigned int strl = args[k++]->Int32Value(_context).ToChecked(); + unsigned int strl = args[k]->Int32Value(_context).ToChecked(); param_size[j] = static_cast(strl); if (strl < 1) @@ -222,7 +222,6 @@ namespace sampnode char* mycell = new char[strl](); params[j++] = &mycell[0]; vars++; - i++; } break; @@ -305,7 +304,6 @@ namespace sampnode s_str[s_len - 1] = '\0'; arr->Set(_context, vars++, v8::String::NewFromUtf8(args.GetIsolate(), s_str).ToLocalChecked()); - i++; delete[] static_cast(params[j++]); } @@ -518,7 +516,7 @@ namespace sampnode case 'S': { - unsigned int strl = args[k++]->Int32Value(_context).ToChecked(); + unsigned int strl = args[k]->Int32Value(_context).ToChecked(); param_size[j] = static_cast(strl); if (strl < 1) @@ -531,7 +529,6 @@ namespace sampnode char* mycell = new char[strl](); params[j++] = &mycell[0]; vars++; - i++; } break; @@ -614,7 +611,6 @@ namespace sampnode s_str[s_len - 1] = '\0'; arr->Set(_context, vars++, v8::String::NewFromUtf8(args.GetIsolate(), s_str).ToLocalChecked()); - i++; delete[] static_cast(params[j++]); }