From 624581f4702ec51899d417d4e3135900a705b739 Mon Sep 17 00:00:00 2001 From: Julian Smith Date: Thu, 26 Aug 2021 22:18:36 +0100 Subject: [PATCH] simgear/nasal/code.c:logError(): simplified the code. --- simgear/nasal/code.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/simgear/nasal/code.c b/simgear/nasal/code.c index 41b64e78..5662de8c 100644 --- a/simgear/nasal/code.c +++ b/simgear/nasal/code.c @@ -983,16 +983,14 @@ naRef naContinue(naContext ctx) static void logError(naContext ctx) { - int i, stack_depth = naStackDepth(ctx); printf("Nasal runtime error: %s\n", naGetError(ctx)); - if( stack_depth < 1 ) - return; - printf(" at %s\n", naStr_data(naGetSourceFile(ctx, 0))); - printf(", line %d\n", naGetLine(ctx, 0)); - for(i = 1; i < stack_depth; ++i ) - printf( " called from: %s, line %d", + int stack_depth = naStackDepth(ctx); + for (int i=0; i