# std.Progress: fix suffix printing · gitcafe/zig

[View on GitCafe](https://git.cafe/gitcafe/zig/commit/8ed792b640ef3601dfb773d670915d74fbbbad13)

Repository: [gitcafe/zig](https://git.cafe/gitcafe/zig)

Visibility: public

Requested revision: 8ed792b640ef3601dfb773d670915d74fbbbad13

Requested commit: 8ed792b640ef3601dfb773d670915d74fbbbad13

Commit: 8ed792b640ef3601dfb773d670915d74fbbbad13

Tree: 8f5060f3d06d23275ebb2852a25bdf9dc3defb81

Author: erikarvstedt

Committer: GitHub

## Message

```
std.Progress: fix suffix printing

Previously, `suffix` was copied to `output_buffer` at position
`max_end`, thereby writing into reserved space after `max_end`.
This only worked because `suffix` was not larger than
`bytes_needed_for_esc_codes_at_end` (otherwise there'd be a potential
buffer overrun) and no escape codes at end are actually written.

Since 2d5b2bf1c986d037ef965bf8c9b4d8dfd5967478, escape codes are no
longer written to the end of the buffer. They are now written
exclusively to the front of the buffer.
This allows removing `bytes_needed_for_esc_codes_at_end` and
simplifying the suffix printing logic.

This also fixes the bug that the ellipse suffix was not printed in
Windows terminals because `end.* > max_end` was never true.
```

## Parents

- [9ca3c897ec546bc08eefe53471c995deefc9f36d](https://git.cafe/gitcafe/zig/commit/9ca3c897ec546bc08eefe53471c995deefc9f36d?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zig/tree/8ed792b640ef3601dfb773d670915d74fbbbad13?format=markdown)
