From: Joel Becker Date: Fri, 13 Jun 2008 05:39:18 +0000 (-0700) Subject: ocfs2: Don't snprintf() without a format. X-Git-Tag: MMI-PSA29.97-13-9~33624^2~8 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=fe9f387740ac7cb3b7c2fffa76807e997e6c6292;p=GitHub%2FMotorolaMobilityLLC%2Fkernel-slsi.git 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: Joel Becker --- diff --git a/fs/ocfs2/ocfs2_fs.h b/fs/ocfs2/ocfs2_fs.h index 52c426665154..3f1945177629 100644 --- a/fs/ocfs2/ocfs2_fs.h +++ b/fs/ocfs2/ocfs2_fs.h @@ -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,