From 3f28bc56a3d78f5921f9db41f463638f559888c6 Mon Sep 17 00:00:00 2001
From: Matthieu Schaller <schaller@strw.leidenuniv.nl>
Date: Mon, 18 Feb 2019 17:29:30 +0100
Subject: [PATCH] Do not print SF info when not running with SF.

---
 examples/main.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/examples/main.c b/examples/main.c
index ecc072c264..6fc5b43371 100644
--- a/examples/main.c
+++ b/examples/main.c
@@ -902,10 +902,11 @@ int main(int argc, char *argv[]) {
     if (myrank == 0) cooling_print(&cooling_func);
 
     /* Initialise the star formation law and its properties */
+    bzero(&starform, sizeof(struct star_formation));
     if (with_star_formation)
       starformation_init(params, &prog_const, &us, &hydro_properties,
                          &starform);
-    if (myrank == 0) starformation_print(&starform);
+    if (with_star_formation && myrank == 0) starformation_print(&starform);
 
     /* Initialise the chemistry */
     bzero(&chemistry, sizeof(struct chemistry_global_data));
-- 
GitLab