diff --git a/R-package/src/lightgbm_R.cpp b/R-package/src/lightgbm_R.cpp index 270f2a2d5..3ae7a98d8 100644 --- a/R-package/src/lightgbm_R.cpp +++ b/R-package/src/lightgbm_R.cpp @@ -40,7 +40,7 @@ void LGBM_R_save_exception_msg(const std::string &err); catch(std::exception& ex) { LGBM_R_save_exception_msg(ex); } \ catch(std::string& ex) { LGBM_R_save_exception_msg(ex); } \ catch(...) { Rf_error("unknown exception"); } \ - Rf_error(R_errmsg_buffer); \ + Rf_error("%s", R_errmsg_buffer); \ return R_NilValue; /* <- won't be reached */ #define CHECK_CALL(x) \