summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Adam <thomas@xteddy.org>2023-08-07 12:01:10 +0100
committerThomas Adam <thomas@xteddy.org>2023-08-07 12:01:10 +0100
commit3e82ad53409676cd67b69554651f94395508d96b (patch)
treef8d0b8b234fe3baefd95e32bd9427b30553992be
parentfda393773485c7c9236e4cf0c18668ab809d2574 (diff)
parenta5fd80bbc3e6a65ce0e3bce4cf820db3ae0f3165 (diff)
Merge branch 'obsd-master'
-rw-r--r--format-draw.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/format-draw.c b/format-draw.c
index 1a7e60b3..3ea1f52f 100644
--- a/format-draw.c
+++ b/format-draw.c
@@ -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);