refactor: use S_LEN(s) instead of s, n (#29219)

This commit is contained in:
James
2024-06-11 22:40:24 +07:00
committed by GitHub
parent 44410d063a
commit c37695a5d5
42 changed files with 263 additions and 258 deletions

View File

@@ -473,7 +473,7 @@ void trunc_string(const char *s, char *buf, int room_in, int buflen)
}
} else if (e + 3 < buflen) {
// set the middle and copy the last part
memmove(buf + e, "...", 3);
memmove(buf + e, S_LEN("..."));
len = (int)strlen(s + i) + 1;
if (len >= buflen - e - 3) {
len = buflen - e - 3 - 1;
@@ -3182,7 +3182,7 @@ static void redir_write(const char *const str, const ptrdiff_t maxlen)
if (*s != '\n' && *s != '\r') {
while (cur_col < msg_col) {
if (capture_ga) {
ga_concat_len(capture_ga, " ", 1);
ga_concat_len(capture_ga, S_LEN(" "));
}
if (redir_reg) {
write_reg_contents(redir_reg, " ", 1, true);