Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-Authored-By: Max Horn <[email protected]>
  • Loading branch information
sebasguts and fingolfin authored Jun 24, 2019
1 parent debefa4 commit b4868d2
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions deps/src/singular.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,8 @@ JLCXX_MODULE define_julia_module(jlcxx::Module & Singular)

// call interpreter
std::string input_str = input + "\nreturn();";
const char * input_string = input_str.c_str();
char * ost = (char *)omalloc0(strlen(input_string) + 1);
strcpy(ost, input_string);
char * ost = (char *)omalloc0(strlen(input_str.length()) + 1);
memcpy(ost, input_str.c_str(), input_str.length() + 1);
bool err = iiAllStart(NULL, ost, BT_proc, 0);
inerror = 0;
errorreported = 0;
Expand All @@ -107,7 +106,7 @@ JLCXX_MODULE define_julia_module(jlcxx::Module & Singular)
jl_arrayset(result, jl_cstr_to_string(singular_error.c_str()), 2);
jl_arrayset(result, jl_cstr_to_string(singular_warning.c_str()), 3);

// reset hanlders
// reset handlers
PrintS_callback = default_print;
WerrorS_callback = default_error;
WarnS_callback = default_warning;
Expand Down

0 comments on commit b4868d2

Please sign in to comment.