From: Jean Delvare Date: Tue, 8 May 2007 07:25:42 +0000 (-0700) Subject: oss: strlcpy is smart enough X-Git-Tag: v2.6.22-rc1~760 X-Git-Url: http://ftp.safe.ca/?a=commitdiff_plain;h=880afc4d76af452267174b5989943f081c1db2c0;p=safe%2Fjmp%2Flinux-2.6 oss: strlcpy is smart enough 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 Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/sound/oss/btaudio.c b/sound/oss/btaudio.c index f813ae9..4d5cf05 100644 --- a/sound/oss/btaudio.c +++ b/sound/oss/btaudio.c @@ -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;