File tree Expand file tree Collapse file tree 2 files changed +3
-4
lines changed Expand file tree Collapse file tree 2 files changed +3
-4
lines changed Original file line number Diff line number Diff line change @@ -304,7 +304,8 @@ namespace ST
304304 ST_NODISCARD
305305 formatter_ref_t make_formatter_ref (type_T value)
306306 {
307- return [value](const ST::format_spec &format, ST::format_writer &output) {
307+ return [value = std::forward<type_T>(value)](
308+ const ST::format_spec &format, ST::format_writer &output) {
308309 format_type (format, output, value);
309310 };
310311 }
Original file line number Diff line number Diff line change @@ -2031,9 +2031,7 @@ namespace ST
20312031 string substr (ST_ssize_t start, size_t count = ST_AUTO_SIZE) const
20322032 {
20332033 size_t max = size ();
2034-
2035- if (count == ST_AUTO_SIZE)
2036- count = max;
2034+ count = std::min<size_t >(max, count);
20372035
20382036 if (start < 0 ) {
20392037 // Handle negative indexes from the right side of the string
You can’t perform that action at this time.
0 commit comments