Skip to content
Commit 67e6e8a1 authored by He Zhe's avatar He Zhe Committed by Bruce Ashfield
Browse files

yaffs2: Fix miscalculation of devname buffer length



The following build warning helps us find a real mishandling of array length.

fs/yaffs2/yaffs_vfs.c:122:29: warning: argument to 'sizeof' in 'snprintf' call
is the same expression as the destination; did you mean to provide an explicit
length? [-Wsizeof-pointer-memaccess]

If an array is passed as a function parameter it'll be treated as a simple
pointer and thus sizeof will return the length of a pointer rather than the
length of the array.

Add and pass the buffer length to make it work correctly.

Signed-off-by: default avatarHe Zhe <zhe.he@windriver.com>
Signed-off-by: default avatarBruce Ashfield <bruce.ashfield@gmail.com>
parent 2fa1539f
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment