69,371
社区成员
发帖
与我相关
我的任务
分享
strncpy(tmp_content,tmpCh+5,pos2-pos1 -1);
char *tmpCh="Host: www.renren.com demonbug=&email=15951983657&password=19921231&origURL=http%3A%2F %2Fwww.renren.com%2Fhome&domain=renren.com";
char tmp_content[50];
char *pos1=NULL;
char *pos2=NULL;
pos1=strstr(tmpCh, "Host:");
pos1=pos1+strlen("Host:");
pos2=strstr(tmpCh, "demonbug");
strncpy(tmp_content, pos1 ,pos2-pos1);
tmp_content[pos2-pos1] = '\0';
printf("%s", tmp_content);
char tmp_content[50] = {0};