Skip to content

Commit

Permalink
finally fixed "-Wformat-security" warning
Browse files Browse the repository at this point in the history
  • Loading branch information
evanbiederstedt committed Feb 27, 2024
1 parent 1dba093 commit cbe90d3
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions src/rigraph/rinterface.c
Original file line number Diff line number Diff line change
Expand Up @@ -197,14 +197,9 @@ SEXP R_igraph_handle_safe_eval_result(SEXP result) {
SEXP condition_message = PROTECT(Rf_install("conditionMessage"));
SEXP condition_message_call = PROTECT(Rf_lang2(condition_message, result));
SEXP evaluated_condition_message = PROTECT(Rf_eval(condition_message_call, R_GlobalEnv));
// error(CHAR(STRING_ELT(evaluated_condition_message, 0)));
// fix for 'format string is not a string literal' flag warning
const char *message_char;
message_char = CHAR(STRING_ELT(evaluated_condition_message, 0));
if (message_char != NULL) {
error(message_char);
} else {
error("Something screwed up in R_igraph_handle_safe_eval_result()");
}
REprintf("%s\n", CHAR(STRING_ELT(evaluated_condition_message, 0)));
UNPROTECT(3);
return R_NilValue;

Expand Down

0 comments on commit cbe90d3

Please sign in to comment.