From 2c7860361de55fb1bce7bec4cf9d117a2ea1ada9 Mon Sep 17 00:00:00 2001 From: Holger Vogt Date: Mon, 17 Dec 2018 21:03:21 +0100 Subject: [PATCH] Prevent segfault if SendStat is NULL and HAVE_FTIME is undefined. Patch no. 28 offered by Liang Chang --- src/sharedspice.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/sharedspice.c b/src/sharedspice.c index 19eb25273..071ab0951 100644 --- a/src/sharedspice.c +++ b/src/sharedspice.c @@ -1611,6 +1611,10 @@ void SetAnalyse( int DecaPercent /*in: 10 times the progress [%]*/ /*HWND hwAnalyse, in: global handle to analysis window */ ) { + /* If caller has sent NULL address for statfcn */ + if (nostatuswanted) + return; + #ifdef HAVE_FTIME static int OldPercent = -2; /* Previous progress value */ static char OldAn[128]; /* Previous analysis type */ @@ -1626,10 +1630,6 @@ void SetAnalyse( if (ft_curckt) ckt = ft_curckt->ci_ckt; - /* If caller has sent NULL address for statfcn */ - if (nostatuswanted) - return; - strcpy(OldAn, "?"); /* initial value */ if ((DecaPercent == OldPercent) && !strcmp(OldAn, Analyse))