fix a potential problem in substr.
fix a potential problem in substr.

microsoft/LightGBM,Laurae2/LightGBM,microsoft/LightGBM,Laurae2/LightGBM,henry0312/LightGBM,henry0312/LightGBM,Laurae2/LightGBM,microsoft/LightGBM,microsoft/LightGBM,Laurae2/LightGBM,henry0312/LightGBM,microsoft/LightGBM,henry0312/LightGBM,henry0312/LightGBM,Laurae2/LightGBM