Commit fe9f3877 authored by Joel Becker's avatar Joel Becker Committed by Mark Fasheh

ocfs2: Don't snprintf() without a format.

Some system files are per-slot.  Their names include the slot number.
ocfs2_sprintf_system_inode_name() uses the system inode definitions to
fill in the slot number with snprintf().

For global system files, there is no node number, and the name was
printed as a format with no arguments.  -Wformat-nonliteral and
-Wformat-security don't like this.  Instead, use a static "%s" format
and the name as the argument.
Signed-off-by: default avatarJoel Becker <joel.becker@oracle.com>
parent e407e397
...@@ -901,7 +901,7 @@ static inline int ocfs2_sprintf_system_inode_name(char *buf, int len, ...@@ -901,7 +901,7 @@ static inline int ocfs2_sprintf_system_inode_name(char *buf, int len,
* list has a copy per slot. * list has a copy per slot.
*/ */
if (type <= OCFS2_LAST_GLOBAL_SYSTEM_INODE) if (type <= OCFS2_LAST_GLOBAL_SYSTEM_INODE)
chars = snprintf(buf, len, chars = snprintf(buf, len, "%s",
ocfs2_system_inodes[type].si_name); ocfs2_system_inodes[type].si_name);
else else
chars = snprintf(buf, len, chars = snprintf(buf, len,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment