mirror of
https://github.com/apache/nuttx-apps.git
synced 2025-10-17 15:32:21 +08:00
Use thread-safe ntoa functions
NXStyle fixes Apply suggestions from code review Co-authored-by: Petro Karashchenko <petro.karashchenko@gmail.com> API fixes and NXStyle fixes Apply suggestions from code review Co-authored-by: Petro Karashchenko <petro.karashchenko@gmail.com> Use thread-safe ntoa functions NXStyle fixes Apply suggestions from code review Co-authored-by: Petro Karashchenko <petro.karashchenko@gmail.com> API fixes and NXStyle fixes Apply suggestions from code review Co-authored-by: Petro Karashchenko <petro.karashchenko@gmail.com>
This commit is contained in:

committed by
Xiang Xiao

parent
c5102fe504
commit
dcd60a2abe
@@ -165,6 +165,8 @@ int main(int argc, FAR char *argv[])
|
||||
if (handle)
|
||||
{
|
||||
struct dhcpc_state ds;
|
||||
char inetaddr[INET_ADDRSTRLEN];
|
||||
|
||||
dhcpc_request(handle, &ds);
|
||||
netlib_set_ipv4addr("eth0", &ds.ipaddr);
|
||||
|
||||
@@ -184,7 +186,7 @@ int main(int argc, FAR char *argv[])
|
||||
}
|
||||
|
||||
dhcpc_close(handle);
|
||||
printf("IP: %s\n", inet_ntoa(ds.ipaddr));
|
||||
printf("IP: %s\n", inet_ntoa_r(ds.ipaddr, inetaddr, sizeof(inetaddr)));
|
||||
}
|
||||
#endif
|
||||
#endif /* CONFIG_NSH_NETINIT */
|
||||
|
Reference in New Issue
Block a user