]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
ocfs2: Don't snprintf() without a format.
authorJoel Becker <joel.becker@oracle.com>
Fri, 13 Jun 2008 05:39:18 +0000 (22:39 -0700)
committerMark Fasheh <mfasheh@suse.com>
Mon, 14 Jul 2008 20:57:15 +0000 (13:57 -0700)
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: Joel Becker <joel.becker@oracle.com>
fs/ocfs2/ocfs2_fs.h

index 52c426665154312cb0d7c812bed5f0b928a8e62d..3f1945177629d7cdbfc84779cb37536d38e9dff5 100644 (file)
@@ -901,7 +901,7 @@ static inline int ocfs2_sprintf_system_inode_name(char *buf, int len,
          * list has a copy per slot.
          */
        if (type <= OCFS2_LAST_GLOBAL_SYSTEM_INODE)
-               chars = snprintf(buf, len,
+               chars = snprintf(buf, len, "%s",
                                 ocfs2_system_inodes[type].si_name);
        else
                chars = snprintf(buf, len,