From e053e745fdc7545b5e024a002b97e9bac50145a5 Mon Sep 17 00:00:00 2001 From: minqiyang Date: Mon, 2 Jul 2018 20:49:55 +0800 Subject: [PATCH] Fix bug --- paddle/fluid/string/printf.h | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/paddle/fluid/string/printf.h b/paddle/fluid/string/printf.h index 65dec970d..3b40c6029 100644 --- a/paddle/fluid/string/printf.h +++ b/paddle/fluid/string/printf.h @@ -85,11 +85,9 @@ void Fprintf(std::ostream& out, const char* fmt, const Args&... args) { template std::string Sprintf(const Args&... args) { - if (0u == sizeof...(args)) { - Sprintf("", args); - } - - return Sprintf(args, args); + std::ostringstream oss; + Fprintf(oss, "", args...); + return oss.str(); } template -- GitLab