lwIP | rtemslwip/network_compat: Add gethostname/gethostid (!28)
Kinsey Moore (@opticron)
gitlab at rtems.org
Mon Sep 8 20:21:35 UTC 2025
Kinsey Moore commented on a discussion on rtemslwip/common/network_compat.c: https://gitlab.rtems.org/rtems/pkg/rtems-lwip/-/merge_requests/28#note_130589
> + return -1;
> + }
> + if (size == 0) {
> + errno = ENAMETOOLONG;
> + return -1;
> + }
> + if (copy_size > size) {
> + /* Ensure space for the null */
> + copy_size = size - 1;
> + }
> +
> + memcpy(name, hostname, copy_size);
> + /* Enforce null termination of output */
> + name[copy_size] = '\0';
> +
> + if (size < hostname_len) {
Done. Sorry, the switch to ensuring null termination has totally thrown me off.
--
View it on GitLab: https://gitlab.rtems.org/rtems/pkg/rtems-lwip/-/merge_requests/28#note_130589
You're receiving this email because of your account on gitlab.rtems.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/bugs/attachments/20250908/bb050f34/attachment-0001.htm>
More information about the bugs
mailing list