From 43ced429f6532bf0258207dbb2c3b613340d7126 Mon Sep 17 00:00:00 2001 From: Konstantinos Margaritis Date: Thu, 14 Sep 2023 11:54:51 +0000 Subject: [PATCH] Need to zero homeIsaDir before use --- media/pypowersim_wrapper/pypowersim_wrapper_common.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/media/pypowersim_wrapper/pypowersim_wrapper_common.h b/media/pypowersim_wrapper/pypowersim_wrapper_common.h index 0eaa861c..848809f5 100644 --- a/media/pypowersim_wrapper/pypowersim_wrapper_common.h +++ b/media/pypowersim_wrapper/pypowersim_wrapper_common.h @@ -42,11 +42,11 @@ static pypowersim_state_t *pypowersim_prepare(void) { Py_Initialize(); // To construct directory based on username, need $HOME - char homeIsaDir[100]; + char homeIsaDir[100] = {0}; const char *homeDir = getenv("HOME"); // user specific - /home/[USER NAME] strcat(homeIsaDir, homeDir); strcat(homeIsaDir, "/src/openpower-isa/src/openpower/decoder/isa/"); - printf(homeIsaDir); + printf("homeIsaDir: %s\n", homeIsaDir); PyObject* sysPath = PySys_GetObject((char*)"path"); PyObject* curDir = PyUnicode_FromString(homeIsaDir); -- 2.30.2