few assorted adjustments and a fix for #8883
[super-star-trek.git] / src / sst.c
index c51dc27835fdd853742f6419638befe8087208d2..d0d5d05ec97033fbf774c790f97cc08032f2f34f 100644 (file)
--- a/src/sst.c
+++ b/src/sst.c
@@ -634,11 +634,12 @@ int main(int argc, char **argv)
     }
     /* where to save the input in case of bugs */
     logfp = fopen("/usr/tmp/sst-input.log", "w");
-    setlinebuf(logfp);
-    fprintf(logfp, "seed %d\n", seed);
+    if (logfp) {
+       setlinebuf(logfp);
+       fprintf(logfp, "seed %d\n", seed);
+    }
     srand(seed);
 
-    srand(seed);
     iostart();
 
     line[0] = '\0';