1
0
Fork 0
mirror of git://git.code.sf.net/p/cdesktopenv/code synced 2025-03-09 15:50:02 +00:00

libDtSearch: Coverity 86698

This commit is contained in:
Peter Howkins 2018-07-02 22:48:20 +01:00
parent 3fe9d94879
commit 68986baef8

View file

@ -294,7 +294,7 @@ char *path_str /* Path to remove filename from */
/* There is only a filename if string does not contain a DIRCHAR or
':' which separates drive spec from path. */
if (path_str == NULL) return (NULL);
strcpy(dirpath,path_str); /* Copy into output string */
snprintf(dirpath, sizeof(dirpath), "%s", path_str); /* Copy into output string */
if ((path_str = strrchr(dirpath,DIRCHAR)) == NULL)
if ((path_str = strrchr(dirpath,':')) == NULL) return (NULL);
path_str[1] = '\0'; /* Truncate string */