(bzero, bcopy): Obsolete BSDisms; remove. Remove some calls without
effect. Replace calls by struct assignment where possible. Replace clear buffer, copy string to buffer by strncpy(). Use assignment to clear when that's clearer. Replace overlapping copy through bounce buffer by memmove(). Replace rest by standard memset() and memcpy(). Also use sizeof() instead of literal array sizes for robustness, and instead of symbolic array sizes for clarity.
This commit is contained in:
parent
2910da23ea
commit
4ae9c417b3
79 changed files with 172 additions and 256 deletions
|
@ -65,8 +65,7 @@ struct sockaddr_in *addr;
|
|||
fprintf(stderr, "%s: No such host\n", name);
|
||||
return 0;
|
||||
}
|
||||
bcopy(hp->h_addr, (s_char *)&addr->sin_addr,
|
||||
sizeof(addr->sin_addr));
|
||||
memcpy(&addr->sin_addr, hp->h_addr, sizeof(addr->sin_addr));
|
||||
#ifdef _WIN32
|
||||
printf("Trying to connect to '%s'\n", inet_ntoa(addr->sin_addr));
|
||||
fflush(stdout);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue