core: use string instead of compound literal

fixes compilation when memcpy is defined as a function-like macro at
the cost of one more byte used for the unused zero terminator.

closes #578
This commit is contained in:
rofl0r 2024-08-29 09:31:35 +00:00
parent 821249f22a
commit 1760c93474

View File

@ -999,7 +999,7 @@ err_nn:
} else if(!node && !(hints->ai_flags & AI_PASSIVE)) { } else if(!node && !(hints->ai_flags & AI_PASSIVE)) {
af = ((struct sockaddr_in *) &space->sockaddr_space)->sin_family = AF_INET; af = ((struct sockaddr_in *) &space->sockaddr_space)->sin_family = AF_INET;
memcpy(&((struct sockaddr_in *) &space->sockaddr_space)->sin_addr, memcpy(&((struct sockaddr_in *) &space->sockaddr_space)->sin_addr,
(char[]){127,0,0,1}, 4); "\177\0\0\1", 4);
} }
if(service) mygetservbyname_r(service, NULL, &se_buf, buf, sizeof(buf), &se); if(service) mygetservbyname_r(service, NULL, &se_buf, buf, sizeof(buf), &se);