Skip to content

Commit

Permalink
Merge branch 'asar_19' into asar_2_beta
Browse files Browse the repository at this point in the history
  • Loading branch information
randomdude999 committed Jan 27, 2024
2 parents 2204588 + dffc929 commit 63c8b26
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/asar/assembleblock.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -891,6 +891,8 @@ static void pop_pc()

string handle_print(char* input)
{
// evaluating this math can be unsafe in pass 0
if(pass != 2) return "";
string out;
autoptr<char**> pars = qpsplit(input, ',');
verify_paren(pars);
Expand All @@ -909,13 +911,13 @@ string handle_print(char* input)
char * arg1pos = strchr(pars[i], '(') + 1;
char * endpos = strchr(arg1pos, '\0');
while (*endpos == ' ' || *endpos == '\0') endpos--;
if (*endpos != ')') asar_throw_error(0, error_type_block, error_id_invalid_print_function_syntax);
if (*endpos != ')') asar_throw_error(2, error_type_block, error_id_invalid_print_function_syntax);
string paramstr = string(arg1pos, (int)(endpos - arg1pos));

int numargs;
autoptr<char**> params = qpsplit(paramstr.temp_raw(), ',', &numargs);
verify_paren(params);
if (numargs > 2) asar_throw_error(0, error_type_block, error_id_wrong_num_parameters);
if (numargs > 2) asar_throw_error(2, error_type_block, error_id_wrong_num_parameters);
int precision = 0;
bool hasprec = numargs == 2;
if (hasprec)
Expand Down

0 comments on commit 63c8b26

Please sign in to comment.