diff options
-rw-r--r-- | src/Sockets.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/Sockets.c b/src/Sockets.c index 7d6d709..db66102 100644 --- a/src/Sockets.c +++ b/src/Sockets.c @@ -163,7 +163,10 @@ int HTTP_SetupServer(int port, int queue_size, int hunt) char msg[141]; char *this_user = getenv("USER"); if (!this_user) this_user = "unknown"; - snprintf(msg, 140, "HTTPD by %s on http://%s:%lu/\n", this_user, hostname, httpport); + /* We do not want 'hostname' here because that can be wrong and not be overwritten */ + char *myhostname = getenv("HOSTNAME"); + if (!myhostname) myhostname = hostname; + snprintf(msg, 140, "HTTPD by %s on http://%s:%lu/\n", this_user, myhostname, httpport); Send_Twitter_Msg(msg); } else printf("Not announcing location via Twitter.\n"); |