char pch[2];改为char *pch;if (pch = (char *)malloc(100) == NULL)改为if ((pch = (char *)malloc(100))== NULL) close(pch);改为free(pch);