gcc编译程序崩溃了!

程序如下:
#include<stdio.h>

void escape(char *s,char *t)
{
char *toend=s;
while(toend!='\0') toend++;//to the end of source
while(t!='\0')
{
switch(*t)
{
case '\t':
s[toend++]='\\';
s[toend++]='t';
t++;
break;
case '\n':
s[toend++]='\\';
s[toend++]='n';
t++;
break;
default:
s[toend++]=*t;
t++;
break;
}
}
s[oend]='\0';
}

int main(void)
{
char s[]="abc";
char t[]="a\tb";
escape(s,t);
printf("%s\n",s);
return 0;
}


结果一gcc就报错

不能从先前的错误中恢复,退出
Preprocessed source stored into /tmp/ccv9Anwz.out file, please attach this to your bugreport.

你可能感兴趣的:(gcc)