mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2025-04-16 08:43:17 +00:00
netdb: Use LWIP_MEM_ALIGN_BUFFER instead of open coded
Signed-off-by: Axel Lin <axel.lin@ingics.com>
This commit is contained in:
parent
3e30dbc75c
commit
855ea02b15
@ -187,7 +187,7 @@ lwip_gethostbyname_r(const char *name, struct hostent *ret, char *buf,
|
|||||||
}
|
}
|
||||||
|
|
||||||
namelen = strlen(name);
|
namelen = strlen(name);
|
||||||
if (buflen < (sizeof(struct gethostbyname_r_helper) + namelen + 1 + (MEM_ALIGNMENT - 1))) {
|
if (buflen < (sizeof(struct gethostbyname_r_helper) + LWIP_MEM_ALIGN_BUFFER(namelen + 1))) {
|
||||||
/* buf can't hold the data needed + a copy of name */
|
/* buf can't hold the data needed + a copy of name */
|
||||||
*h_errnop = ERANGE;
|
*h_errnop = ERANGE;
|
||||||
return -1;
|
return -1;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user