Commit 38b65e5f authored by Guolin Ke's avatar Guolin Ke
Browse files

fix a warning

parent f42e6c36
...@@ -38,7 +38,7 @@ LGBM_SE EncodeChar(LGBM_SE dest, const char* src, LGBM_SE buf_len, LGBM_SE actua ...@@ -38,7 +38,7 @@ LGBM_SE EncodeChar(LGBM_SE dest, const char* src, LGBM_SE buf_len, LGBM_SE actua
Log::Fatal("Don't support large string in R-package."); Log::Fatal("Don't support large string in R-package.");
} }
R_INT_PTR(actual_len)[0] = static_cast<int>(str_len); R_INT_PTR(actual_len)[0] = static_cast<int>(str_len);
if (R_AS_INT(buf_len) < str_len) { return dest; } if (R_AS_INT(buf_len) < static_cast<int>(str_len)) { return dest; }
auto ptr = R_CHAR_PTR(dest); auto ptr = R_CHAR_PTR(dest);
std::memcpy(ptr, src, str_len); std::memcpy(ptr, src, str_len);
return dest; return dest;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment