blob: 54c5292a644027c23230ee86a0330a9767356608 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
|
--- net/instaweb/util/hostname_util.cc.orig 2012-12-02 20:27:11.000000000 +0000
+++ net/instaweb/util/hostname_util.cc 2012-12-02 20:43:33.000000000 +0000
@@ -29,7 +29,8 @@
namespace net_instaweb {
GoogleString GetHostname() {
- char hostname[HOST_NAME_MAX + 1];
+ int hnm = sysconf(_SC_HOST_NAME_MAX);
+ char hostname[hnm + 1];
hostname[sizeof(hostname) - 1] = '\0';
// This call really shouldn't fail, so crash if it does under Debug,
|