Skip to content

Commit

Permalink
[R] fix EncodeChar
Browse files Browse the repository at this point in the history
  • Loading branch information
guolinke committed Nov 30, 2017
1 parent d51f2b4 commit 63b6082
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/lightgbm_R.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@
using namespace LightGBM;

LGBM_SE EncodeChar(LGBM_SE dest, const char* src, LGBM_SE buf_len, LGBM_SE actual_len) {
size_t str_len = std::strlen(src);
// +1 for '\0'
size_t str_len = std::strlen(src) + 1;
if (str_len > INT32_MAX) {
Log::Fatal("Don't support large string in R-package.");
}
Expand Down

0 comments on commit 63b6082

Please sign in to comment.