⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 clean.c

📁 Free Chat beta release 2 fot linux,采用C语言写的运行在linux下的聊天室程序
💻 C
字号:
/*  clean.c    For Free Chat    By Bill Kendrick  kendrick@zippy.sonoma.edu  http://zippy.sonoma.edu/kendrick/    September 29, 1996 - June 10, 1997*/#include <stdio.h>#include <stdlib.h>#include <string.h>#include "clean.h"#include "defines.h"void clean(char * str){  char newstr[STRLEN], temp[10];  int i, l;  int c;    strcpy(newstr, "");    for (i = 0; i < strlen(str); i++)    {      c = str[i];            if ((c < 32 || c > 127) && INTERNATIONAL == NO)	c = ' ';          if (c == '<')	strcat(newstr, "&lt;");      else if (c == '>')	strcat(newstr, "&gt;");      else if (c == '&')	strcat(newstr, "&amp;");      else	{	  sprintf(temp, "%c", c);	  strcat(newstr, temp);	}    }    while (isspace(newstr[0]))    {      strcpy(str, newstr + 1);      strcpy(newstr, str);    }    while (isspace(newstr[strlen(newstr) - 1]))    newstr[strlen(newstr) - 1] = '\0';    strcpy(str, newstr);}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -