fix buf when gen_segs in gen_segs.sh  @lifulong