Commit Diff
- Commit:
d194664ffaf3774df69bc267ebc173bed44892a3
- From:
- Omar Polo <op@omarpolo.com>
- Date:
- Message:
- 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.
- Actions:
- Patch | Tree
--- 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;