libsffs: resolve Coverity warnings

This commit is contained in:
David van Moolenbroek 2012-07-27 16:30:58 +00:00
parent 0b30c0a1bb
commit ee71bbbcb5
2 changed files with 4 additions and 4 deletions

View file

@ -82,7 +82,7 @@ struct inode *ino;
link_inode(parent, ino);
strcpy(ino->i_name, name);
strlcpy(ino->i_name, name, sizeof(ino->i_name));
/* hash_add(ino); */
slot = hash_dentry(parent, ino->i_name);

View file

@ -58,8 +58,8 @@ struct inode *ino;
*/
if (!prefix[0] && p[0] == '/') p++;
strcpy(path, prefix);
strcpy(&path[plen], p);
strlcpy(path, prefix, PATH_MAX);
strlcpy(&path[plen], p, PATH_MAX - plen);
dprintf(("%s: make_path: resulting path is '%s'\n", sffs_name, path));
@ -85,7 +85,7 @@ char *name;
return ENAMETOOLONG;
if (len > 0) path[len++] = '/';
strcpy(&path[len], name);
strlcpy(&path[len], name, PATH_MAX - len);
return OK;
}