libDtSearch: Coverity 86698

This commit is contained in:
Peter Howkins 2018-07-02 22:48:20 +01:00
parent 3fe9d94879
commit 68986baef8
1 changed files with 1 additions and 1 deletions

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 */