diff mbox

paflof: Print stack warning to stderr, not stdout

Message ID 1496924609-19378-1-git-send-email-thuth@redhat.com
State Accepted
Headers show

Commit Message

Thomas Huth June 8, 2017, 12:23 p.m. UTC
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@redhat.com>
---
 slof/paflof.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Alexey Kardashevskiy June 15, 2017, 6:13 a.m. UTC | #1
On 08/06/17 22:23, Thomas Huth wrote:
> 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.
> 

Thanks, applied.

> Signed-off-by: Thomas Huth <thuth@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;
>  	}
>  
>
diff mbox

Patch

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;
 	}