1
0
Fork 0
mirror of git://git.code.sf.net/p/cdesktopenv/code synced 2025-02-15 04:32:24 +00:00

dtfile/SharedProcs.c: rework coverity 174852 fix to unbreak dtfile

This commit is contained in:
Jon Trulson 2018-04-03 20:59:48 -06:00
parent 8f7c874ba0
commit f7d09f054d

View file

@ -1631,6 +1631,7 @@ _DtPathFromInput(
FILE *pfp;
char command[MAXPATHLEN];
memset(command, 0, sizeof(command));
sprintf(command,"echo %s",path);
if((pfp=popen(command,"r")) != NULL)
@ -1656,7 +1657,11 @@ _DtPathFromInput(
if (read_ok)
{
command[MAXPATHLEN-1] = '\0';
int slen = strlen(command);
/* need to remove the trailing newline safely*/
if (slen >= 1)
command[slen-1] = '\0';
XtFree(path);
path = XtNewString(command);
pclose(pfp);