File tree Expand file tree Collapse file tree 1 file changed +15
-6
lines changed Expand file tree Collapse file tree 1 file changed +15
-6
lines changed Original file line number Diff line number Diff line change @@ -67,16 +67,17 @@ class Sink {
67
67
if (*(++fmt) == ' {' ) {
68
68
buffer << *fmt++;
69
69
} else {
70
- std::cerr
71
- << error_prefix
72
- << " No arguments provided and braces not escaped! " ;
70
+ std::cerr << error_prefix
71
+ << " No arguments provided and braces not escaped! "
72
+ << std::endl ;
73
73
}
74
74
} else if (*fmt == ' }' ) {
75
75
if (*(++fmt) == ' }' ) {
76
76
buffer << *fmt++;
77
77
} else {
78
78
std::cerr << error_prefix
79
- << " Closing curly brace not escaped!" ;
79
+ << " Closing curly brace not escaped!"
80
+ << std::endl;
80
81
}
81
82
}
82
83
}
@@ -97,7 +98,7 @@ class Sink {
97
98
buffer << *fmt++;
98
99
} else if (*fmt != ' }' ) {
99
100
std::cerr << error_prefix
100
- << " Only empty braces are allowed!" ;
101
+ << " Only empty braces are allowed!" << std::endl ;
101
102
} else {
102
103
buffer << arg;
103
104
arg_printed = true ;
@@ -107,9 +108,17 @@ class Sink {
107
108
buffer << *fmt++;
108
109
} else {
109
110
std::cerr << error_prefix
110
- << " Closing curly brace not escaped!" ;
111
+ << " Closing curly brace not escaped!"
112
+ << std::endl;
111
113
}
112
114
}
115
+
116
+ if (*fmt == ' \0 ' ) {
117
+ std::cerr << error_prefix << " Too many arguments!" << std::endl;
118
+ // ignore all left arguments and finalize message
119
+ format (buffer, fmt);
120
+ return ;
121
+ }
113
122
}
114
123
115
124
format (buffer, ++fmt, std::forward<Args &&>(args)...);
You can’t perform that action at this time.
0 commit comments