From: <st...@us...> - 2014-01-13 10:45:08
|
Revision: 7346 http://sourceforge.net/p/xymon/code/7346 Author: storner Date: 2014-01-13 10:45:03 +0000 (Mon, 13 Jan 2014) Log Message: ----------- xymonlaunch: Fix embarassing crash in xymonlaunch when trying to find tasks.cfg (introduced in 4.3.12) Modified Paths: -------------- branches/4.3.14/common/xymonlaunch.c Modified: branches/4.3.14/common/xymonlaunch.c =================================================================== --- branches/4.3.14/common/xymonlaunch.c 2014-01-10 09:29:38 UTC (rev 7345) +++ branches/4.3.14/common/xymonlaunch.c 2014-01-13 10:45:03 UTC (rev 7346) @@ -543,9 +543,8 @@ else if (stat("/etc/xymon/tasks.cfg", &st) != -1) config = strdup("/etc/xymon/tasks.cfg"); else if (stat("/etc/xymon-client/clientlaunch.cfg", &st) != -1) config = strdup("/etc/xymon-client/clientlaunch.cfg"); else if (xgetenv("XYMONHOME")) { - char *pf = NULL; - sprintf(pf, "%s/etc/tasks.cfg", xgetenv("XYMONHOME")); - if (pf && stat(pf, &st) != -1) config = strdup(pf); + config = (char *)malloc(strlen(xgetenv("XYMONHOME")) + strlen("/etc/tasks.cfg") + 1); + sprintf(config, "%s/etc/tasks.cfg", xgetenv("XYMONHOME")); } if (config) dbgprintf("Using config file: %s\n", config); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |