合并字符串 strcpy和 strcat,中间参杂了fgets()函数

新手上路,请各位老师多多关照。
今晚在学习的过程中,碰到一个问题 ,代码如下:

#include
#include
int main()
{
FILE *yuan =NULL;
FILE *res2 =NULL;
yuan = fopen("111.txt","r");//打开文件
res2 = fopen("res2.txt","w");//创建res.txt

for (int i = 1;i<6;i++)
{ 
    char date[] = "20181113";
    char no[] = "010";
    char bl[6];
    char he[255]=""; 
    strcpy(he,no);  //no赋值 
    printf("%d,:%s\n",i,he);
    strcat(he,date);//加date字符串 
    fgets(bl,255,yuan);
    strcat(he,bl);
    printf("%d,%s",i,he);
    fputs(he,res2);
}   
fclose(yuan);
fclose(res2);
return 0; 

}
结果如下:
1,:010
1,01020181113aaaaa
2,:010
2,01020181113bbbbb
3,:010
3,01020181113ccccc
4,:010
4,01020181113ddddd
5,:010
5,01020181113eeeee

但是,我一开始的时候把fgets()函数的语句放在了前面,出现了问题,代码如下:

#include
#include
int main()
{
FILE *yuan =NULL;
FILE *res2 =NULL;
yuan = fopen("111.txt","r");//打开文件
res2 = fopen("res2.txt","w");//创建res.txt

for (int i = 1;i<6;i++)
{ 
    char date[] = "20181113";
    char no[] = "010";
    char bl[6];
    fgets(bl,255,yuan);
    char he[255]=""; 
    strcpy(he,no);  //no赋值 
    printf("%d,:%s\n",i,he);
    strcat(he,date);//加date字符串 
    strcat(he,bl);
    printf("%d,%s",i,he);
    fputs(he,res2);
//fflush(stdin);
}   
fclose(yuan);
fclose(res2);
return 0; 

}

结果为:
1,:
1,20181113aaaaa
2,:
2,20181113bbbbb
3,:
3,20181113ccccc
4,:
4,20181113ddddd
5,:010
5,01020181113eeeee

其中前四次的no字符串都没有了,这是什么原因呢?

你的输入的文件是什么不知道
你的代码也没有发正确。
你说怎么回答?
建议你调试下
fgets(bl,255,yuan);
这里缓冲区bl是6个字符,最多读取5个字符,看看是不是有越界