oss: strlcpy is smart enough
authorJean Delvare <khali@linux-fr.org>
Tue, 8 May 2007 07:25:42 +0000 (00:25 -0700)
committerLinus Torvalds <torvalds@woody.linux-foundation.org>
Tue, 8 May 2007 18:15:01 +0000 (11:15 -0700)
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>
sound/oss/btaudio.c

index f813ae9c2134e2e7b17f41c486bf23c7d167a543..4d5cf05b8922605421a09a9716c957782c771635 100644 (file)
@@ -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;