From 6d77989714b610094929cc939cbc8ee54f169622 Mon Sep 17 00:00:00 2001 From: Alja Mrak-Tadel Date: Fri, 8 May 2015 16:53:45 -0700 Subject: [PATCH] Fix snprintf format error when printing configuration status. --- src/XrdFileCache/XrdFileCacheFactory.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/XrdFileCache/XrdFileCacheFactory.cc b/src/XrdFileCache/XrdFileCacheFactory.cc index b89d2c8c90c..276844a56fb 100644 --- a/src/XrdFileCache/XrdFileCacheFactory.cc +++ b/src/XrdFileCache/XrdFileCacheFactory.cc @@ -270,7 +270,7 @@ bool Factory::Config(XrdSysLogger *logger, const char *config_filename, const ch { char buff2[512]; snprintf(buff2, sizeof(buff2), "\tpfc.hdfsmode hdfsbsize %lld\n", m_configuration.m_hdfsbsize); - loff += snprintf(&buff[loff], strlen(buff2), buff2); + loff += snprintf(&buff[loff], strlen(buff2), "%s", buff2); } @@ -280,8 +280,8 @@ bool Factory::Config(XrdSysLogger *logger, const char *config_filename, const ch m_configuration.m_username = unameBuff; } else { - snprintf(unameBuff, sizeof(unameBuff), "\tpfc.user %s \n", m_configuration.m_username.c_str()); - loff += snprintf(&buff[loff], strlen(unameBuff), unameBuff); + snprintf(unameBuff, sizeof(unameBuff), "\tpfc.user %s \n", m_configuration.m_username.c_str()); + loff += snprintf(&buff[loff], strlen(unameBuff), "%s", unameBuff); } m_log.Emsg("Config", buff);