From 61deabd7875a8d22a4ba90feecac6dcd8acedd18 Mon Sep 17 00:00:00 2001 From: Jerzy Jamroz Date: Mon, 10 Feb 2025 11:10:03 +0100 Subject: [PATCH] fix: CMP=vs2012 (error C2143) variables to the top of a function. --- modules/libcom/src/iocsh/atInit.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/libcom/src/iocsh/atInit.c b/modules/libcom/src/iocsh/atInit.c index 9daf0cc2d..7338588ae 100644 --- a/modules/libcom/src/iocsh/atInit.c +++ b/modules/libcom/src/iocsh/atInit.c @@ -31,11 +31,11 @@ static int s_initendflag = 0; // Defines the end of the initialization static void atInitHook(initHookState state) { + struct cmditem *item = NULL; + if (state != initHookAfterIocRunning) return; - struct cmditem *item = NULL; - while ((item = (struct cmditem *)ellGet(&s_cmdlist))) { printf("%s\n", item->cmd);