[SLOF] [PATCH] paflof: Print stack warning to stderr, not stdout

Thomas Huth thuth at redhat.com
Thu Jun 8 22:23:29 AEST 2017


Now that stdout is routed through the TYPE Forth word, we should
avoid using stdout in critical sections in the engine() function.
So print the stack warning via stderr now instead.

Signed-off-by: Thomas Huth <thuth at redhat.com>
---
 slof/paflof.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/slof/paflof.c b/slof/paflof.c
index 5c4f4e1..50b4adf 100644
--- a/slof/paflof.c
+++ b/slof/paflof.c
@@ -90,7 +90,7 @@ long engine(int mode, long param_1, long param_2)
 	}
 
 	if ((char *)&ip < the_system_stack && !did_stackwarning) {
-		puts("ERROR: stack overflow in engine()!");
+		fprintf(stderr, "\nERROR: stack overflow in engine()!\n");
 		did_stackwarning = 1;
 	}
 
-- 
1.8.3.1



More information about the SLOF mailing list