int resp = recv(s, buf, len, flags); if(resp == 18) { char data[18]; strcpy(data, buf); ... }
我期望strlen(data)等于18,但它不是。我错过了什么?
如果你的data包含一个零字节的
data