summaryrefslogtreecommitdiffstats
path: root/src/color.c
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@tavianator.com>2024-10-17 12:23:03 -0400
committerTavian Barnes <tavianator@tavianator.com>2024-10-17 12:23:03 -0400
commitefb24a431007012a31641b25ea2c1857d5d8d803 (patch)
treeff8b87c6424c009c995cc587cb4b357c61041843 /src/color.c
parent1520d4d3fe297f34bbbf128ab7c3d1b735fab517 (diff)
downloadbfs-efb24a431007012a31641b25ea2c1857d5d8d803.tar.xz
dstring: Add an infallible dstrshrink() function
And mark the fallible ones with _nodiscard.
Diffstat (limited to 'src/color.c')
-rw-r--r--src/color.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/color.c b/src/color.c
index 9ac7b85..036dda5 100644
--- a/src/color.c
+++ b/src/color.c
@@ -920,7 +920,7 @@ static int cpath_init(struct cpath *cpath, const char *path, const struct BFTW *
}
cpath_retreat(cpath);
- dstresize(&at_path, at_off + cpath->valid);
+ dstrshrink(at_path, at_off + cpath->valid);
}
dstrfree(at_path);
@@ -1518,7 +1518,7 @@ int cvfprintf(CFILE *cfile, const char *format, va_list args) {
}
}
- dstresize(&cfile->buffer, 0);
+ dstrshrink(cfile->buffer, 0);
return ret;
}