Andrew's git
/
gitweb.git
/ blobdiff
summary
|
log
|
commit
|
diff
|
tree
commit
grep
author
committer
pickaxe
?
re
use HOST_NAME_MAX to size buffers for gethostname(2)
[gitweb.git]
/
ident.c
diff --git
a/ident.c
b/ident.c
index d17b5bd341eccd604c849201fb1f13153be9736e..8ec0f25987540ccf64230b6aad4c6e2323d43455 100644
(file)
--- a/
ident.c
+++ b/
ident.c
@@
-120,7
+120,7
@@
static int canonical_name(const char *host, struct strbuf *out)
static void add_domainname(struct strbuf *out, int *is_bogus)
{
- char buf[
1024
];
+ char buf[
HOST_NAME_MAX + 1
];
if (gethostname(buf, sizeof(buf))) {
warning_errno("cannot get host name");