From fd9544663694ebee0268c37fd98aa2edbaa06c48 Mon Sep 17 00:00:00 2001 From: Benjamin Loison Date: Tue, 20 Dec 2022 15:46:31 +0100 Subject: [PATCH] Modify C `main` to initialize correctly the state with `is_reset = false` --- src/cprint.ml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/cprint.ml b/src/cprint.ml index 9585e6f..20a96a5 100644 --- a/src/cprint.ml +++ b/src/cprint.ml @@ -323,7 +323,9 @@ let cp_main_fn fmt (prog, sts) = Format.fprintf fmt "int main (int argc, char **argv)\n\ {\n%a\n\ \tchar _buffer[1024];\n\ - \tt_state_main state; state.is_init = true;\n\ + \tt_state_main state;\n\ + \tstate.is_init = true;\n\ + \tstate.is_reset = false;\n\ \twhile(true) {\n\ \t\tscanf(\"%%s\", _buffer);\n\ \t\tif(!strcmp(_buffer, \"exit\")) { exit (EXIT_SUCCESS); }\n\