commit 851f7c92c73b922e7e43e38d287351ac3c2bb788 from: Omar Polo via: Thomas Adam date: Tue Sep 10 15:35:27 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 - c649655b96196a545730ebcbc6f8c2319e27775f commit + 851f7c92c73b922e7e43e38d287351ac3c2bb788 blob - 79e8f6bd205c1b0270dd6d8a73049cb61bc8e7f8 blob + eadbec7495d802fc8813ce3fd2337aa1b5c159c5 --- gotd/gotd.c +++ gotd/gotd.c @@ -2089,7 +2089,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;