src/lib/cheapcgi.c 1.124

1.124 2009/07/06 22:56:22 angie
Don't printf something that might be NULL -- it segv's on Solaris.
Index: src/lib/cheapcgi.c
===================================================================
RCS file: /projects/compbio/cvsroot/kent/src/lib/cheapcgi.c,v
retrieving revision 1.123
retrieving revision 1.124
diff -b -B -U 4 -r1.123 -r1.124
--- src/lib/cheapcgi.c	18 Jun 2009 17:53:38 -0000	1.123
+++ src/lib/cheapcgi.c	6 Jul 2009 22:56:22 -0000	1.124
@@ -1643,9 +1643,12 @@
     *pArgc = argcLeft;
     }
 putenv("REQUEST_METHOD=GET");
 putenv(queryString);
-safef(hostLine, sizeof(hostLine), "SERVER_NAME=%s", getenv("HOST"));
+char *host = getenv("HOST");
+if (host == NULL)
+    host = "unknown";
+safef(hostLine, sizeof(hostLine), "SERVER_NAME=%s", host);
 putenv(hostLine);
 initCgiInput();
 return gotAny;
 }