From: Fabian Frederick Date: Thu, 22 May 2014 00:43:54 +0000 (+1000) Subject: fs/befs/linuxvfs.c: replace strncpy by strlcpy X-Git-Tag: next-20140530~2^2~105 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=3372af743f94c83b5fef3cf102d5e4536ceca28a;p=karo-tx-linux.git fs/befs/linuxvfs.c: replace strncpy by strlcpy strncpy + end of string assignment replaced by strlcpy Signed-off-by: Fabian Frederick Signed-off-by: Andrew Morton --- diff --git a/fs/befs/linuxvfs.c b/fs/befs/linuxvfs.c index d626756ff721..1e27cd33f7f2 100644 --- a/fs/befs/linuxvfs.c +++ b/fs/befs/linuxvfs.c @@ -396,9 +396,8 @@ static struct inode *befs_iget(struct super_block *sb, unsigned long ino) if (S_ISLNK(inode->i_mode) && !(befs_ino->i_flags & BEFS_LONG_SYMLINK)){ inode->i_size = 0; inode->i_blocks = befs_sb->block_size / VFS_BLOCK_SIZE; - strncpy(befs_ino->i_data.symlink, raw_inode->data.symlink, - BEFS_SYMLINK_LEN - 1); - befs_ino->i_data.symlink[BEFS_SYMLINK_LEN - 1] = '\0'; + strlcpy(befs_ino->i_data.symlink, raw_inode->data.symlink, + BEFS_SYMLINK_LEN); } else { int num_blks;