commit d194664ffaf3774df69bc267ebc173bed44892a3 from: Omar Polo date: Tue Sep 10 15:14:52 2024 UTC use _POSIX_HOST_NAME_MAX instead of HOST_NAME_MAX this is to help -portable. Some systems don't define HOST_NAME_MAX at all, and assume instead that code will use sysctl(_SC_HOST_NAME_MAX) with a VLA or a dynamic allocation, which is completely backward and useless. So, use the _POSIX hammer on this one too. it's dirty, but it's better to strive to avoid gratious -portable changes. reported and discussed with Thomas Adam. commit - 5167b9bce185b01392b59bb7d2501d78cfdb427d commit + d194664ffaf3774df69bc267ebc173bed44892a3 blob - dae76c4625082615a1525efca313529fb5221c27 blob + fa63d7158cd8f380a8721696c604c93400a8d432 --- gotd/gotd.c +++ gotd/gotd.c @@ -2038,7 +2038,7 @@ main(int argc, char **argv) int *pack_fds = NULL, *temp_fds = NULL; struct gotd_repo *repo = NULL; char *default_sender = NULL; - char hostname[HOST_NAME_MAX + 1]; + char hostname[_POSIX_HOST_NAME_MAX + 1]; FILE *fp; FILE *diff_f1 = NULL, *diff_f2 = NULL; int diff_fd1 = -1, diff_fd2 = -1;