Skip to content

Commit

Permalink
oss: strlcpy is smart enough
Browse files Browse the repository at this point in the history
strlcpy already accounts for the trailing zero in its length
computation, so there is no need to substract one to the buffer size.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Jean Delvare authored and Linus Torvalds committed May 8, 2007
1 parent 6192bd5 commit 880afc4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sound/oss/btaudio.c
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@ static int btaudio_mixer_ioctl(struct inode *inode, struct file *file,
if (cmd == SOUND_OLD_MIXER_INFO) {
_old_mixer_info info;
memset(&info,0,sizeof(info));
strlcpy(info.id,"bt878",sizeof(info.id)-1);
strlcpy(info.id, "bt878", sizeof(info.id));
strlcpy(info.name,"Brooktree Bt878 audio",sizeof(info.name));
if (copy_to_user(argp, &info, sizeof(info)))
return -EFAULT;
Expand Down

0 comments on commit 880afc4

Please sign in to comment.