fix file name length sub 1 for tail NULL