Skip to content

Commit e053e74

Browse files
committed
Fix bug
1 parent 6739797 commit e053e74

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

paddle/fluid/string/printf.h

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -85,11 +85,9 @@ void Fprintf(std::ostream& out, const char* fmt, const Args&... args) {
8585

8686
template <typename... Args>
8787
std::string Sprintf(const Args&... args) {
88-
if (0u == sizeof...(args)) {
89-
Sprintf("", args);
90-
}
91-
92-
return Sprintf(args, args);
88+
std::ostringstream oss;
89+
Fprintf(oss, "", args...);
90+
return oss.str();
9391
}
9492

9593
template <typename... Args>

0 commit comments

Comments
 (0)