diff options
author | Tavian Barnes <tavianator@tavianator.com> | 2024-10-17 12:23:03 -0400 |
---|---|---|
committer | Tavian Barnes <tavianator@tavianator.com> | 2024-10-17 12:23:03 -0400 |
commit | efb24a431007012a31641b25ea2c1857d5d8d803 (patch) | |
tree | ff8b87c6424c009c995cc587cb4b357c61041843 /src/eval.c | |
parent | 1520d4d3fe297f34bbbf128ab7c3d1b735fab517 (diff) | |
download | bfs-efb24a431007012a31641b25ea2c1857d5d8d803.tar.xz |
dstring: Add an infallible dstrshrink() function
And mark the fallible ones with _nodiscard.
Diffstat (limited to 'src/eval.c')
-rw-r--r-- | src/eval.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -1164,7 +1164,7 @@ static void eval_status(struct bfs_eval *state, struct bfs_bar *bar, size_t coun size_t rhslen = xstrwidth(rhs); if (3 + rhslen > width) { - dstresize(&rhs, 0); + dstrshrink(rhs, 0); rhslen = 0; } @@ -1208,7 +1208,7 @@ static void eval_status(struct bfs_eval *state, struct bfs_bar *bar, size_t coun } pathwidth += cwidth; } - dstresize(&status, lhslen); + dstrshrink(status, lhslen); if (dstrcat(&status, "...") != 0) { goto out; |