Author: Paul Wise Description: terminate strings properly before using strlen --- a/src/t_tkcmd.c +++ b/src/t_tkcmd.c @@ -603,6 +603,7 @@ pdgui_path = malloc(n+9); strncpy(pdgui_path, str, n); + pdgui_path[n] = 0; while (strlen(pdgui_path) > 0 && pdgui_path[strlen(pdgui_path)-1] == '/') pdgui_path[strlen(pdgui_path)-1] = 0; if (t = strrchr(pdgui_path, '/'))