Merge branch 'obsd-master'

pull/3661/head
Thomas Adam 2023-08-07 12:01:10 +01:00
commit 3e82ad5340
1 changed files with 2 additions and 2 deletions

View File

@ -1083,7 +1083,7 @@ format_trim_left(const char *expanded, u_int limit)
struct utf8_data ud;
enum utf8_state more;
out = copy = xcalloc(1, strlen(expanded) + 1);
out = copy = xcalloc(2, strlen(expanded) + 1);
while (*cp != '\0') {
if (width >= limit)
break;
@ -1150,7 +1150,7 @@ format_trim_right(const char *expanded, u_int limit)
return (xstrdup(expanded));
skip = total_width - limit;
out = copy = xcalloc(1, strlen(expanded) + 1);
out = copy = xcalloc(2, strlen(expanded) + 1);
while (*cp != '\0') {
if (*cp == '#') {
end = format_leading_hashes(cp, &n, &leading_width);