服务端代码:
1 #include <stdio.h> 2 #include <stdlib.h> 3 #include <string.h> 4 #include <ctype.h> 5 #include <atmi.h> 6 #include <userlog.h> 7 8 static void trim(char *strIn, char *strOut){ 9 10 char *start, *end, *temp; 11 12 temp = strIn; 13 while (*temp == ' ') 14 { 15 ++temp; 16 } 17 18 start = temp; 19 20 temp = strIn + strlen(strIn) - 1; 21 22 while (*temp == ' '){ 23 --temp; 24 } 25 26 end = temp; 27 28 for (strIn = start; strIn <= end;){ 29 *strOut++ = *strIn++; 30 } 31 32 *strOut = '