netdb: Use LWIP_MEM_ALIGN_BUFFER instead of open coded

Signed-off-by: Axel Lin <axel.lin@ingics.com>
This commit is contained in:
Axel Lin 2017-02-03 10:07:48 +08:00 committed by Dirk Ziegelmeier
parent 3e30dbc75c
commit 855ea02b15

View File

@ -187,7 +187,7 @@ lwip_gethostbyname_r(const char *name, struct hostent *ret, char *buf,
}
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 */
*h_errnop = ERANGE;
return -1;