From: Konstantinos Margaritis Date: Thu, 14 Sep 2023 11:54:51 +0000 (+0000) Subject: Need to zero homeIsaDir before use X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=53321166feb5c5e062d9447df84e7d3456afb197;p=openpower-isa.git Need to zero homeIsaDir before use --- 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);