Update server.c

This commit is contained in:
ideawu 2020-10-15 12:14:26 +08:00 committed by GitHub
parent f435ee41fc
commit 8d24162ebc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -38,7 +38,7 @@ int main(int argc, char **argv){
int port;
for(i=0; i<MAX_PORTS; i++){
port = base_port + i;
memset(&addr, sizeof(addr), 0);
memset(&addr, 0, sizeof(addr));
addr.sin_family = AF_INET;
addr.sin_port = htons((short)port);
inet_pton(AF_INET, ip, &addr.sin_addr);