Skip to content

Commit

Permalink
Fix returning string variables
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexander committed Dec 21, 2021
1 parent c10e7d7 commit c9802ab
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/natives.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<cell>(strl);

if (strl < 1)
Expand All @@ -222,7 +222,6 @@ namespace sampnode
char* mycell = new char[strl]();
params[j++] = &mycell[0];
vars++;
i++;
}
break;

Expand Down Expand Up @@ -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<char*>(params[j++]);

}
Expand Down Expand Up @@ -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<cell>(strl);

if (strl < 1)
Expand All @@ -531,7 +529,6 @@ namespace sampnode
char* mycell = new char[strl]();
params[j++] = &mycell[0];
vars++;
i++;
}
break;

Expand Down Expand Up @@ -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<char*>(params[j++]);

}
Expand Down

0 comments on commit c9802ab

Please sign in to comment.