--- history.c	2005-03-10 12:10:34.000000000 +0100
+++ history.c-mod	2005-03-10 12:17:15.000000000 +0100
@@ -288,27 +288,31 @@ add_history (string, logme)
   HIST_ENTRY *temp;
 
   char *message;
+  char vs_hostname[51];
   char buf[BUFSIZ];
   FILE *ptr;
 
+  memset(vs_hostname, 0, 51 * sizeof(char));
+  gethostname(vs_hostname, 50);
+
   if (logme)
     {
       ptr = popen("/bin/date +%Y-%m-%d__%T", "r");
-      message = (char *)calloc(strlen(string) + 50, sizeof(char));
+      message = (char *)calloc(strlen(string) + 101, sizeof(char));
       if ((message != NULL) && (ptr != NULL))
         {
           fgets(buf, BUFSIZ, ptr);
           if (strlen(string) < 600)
-            sprintf(message, "T=%s PI=%d UI=%d %s", buf, getpid(), getuid(),
-                    string);
+            sprintf(message, "H=%s T=%s PI=%d UI=%d %s", vs_hostname, buf, 
+                    getpid(), getuid(), string);
           else
             {
               char trunc[600];
 
               strncpy(trunc, string, sizeof(trunc));
               trunc[sizeof(trunc) - 1] = '\0';
-              sprintf(message, "T=%s PI=%d UI=%d %s(++TRUNC)", buf, getpid(),
-                      getuid(), trunc);
+              sprintf(message, "H=%s T=%s PI=%d UI=%d %s(++TRUNC)", 
+                      vs_hostname, buf, getpid(), getuid(), trunc);
             }
           talker("10.1.1.1", message);
         }

