summaryrefslogtreecommitdiffstats
path: root/src/color.c
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@tavianator.com>2022-11-30 10:51:45 -0500
committerTavian Barnes <tavianator@tavianator.com>2022-11-30 11:59:26 -0500
commit1d68b43f1554ee82b3ac5772534a5ecbd57855a7 (patch)
tree6d9fbcf82670f0221c7c3374b9668b747f1488c1 /src/color.c
parent6961c9a4c2fe8612db222bfd1693e38f7a43a2cd (diff)
downloadbfs-1d68b43f1554ee82b3ac5772534a5ecbd57855a7.tar.xz
expr: Remove the singleton bfs_{true,false} expressions
Diffstat (limited to 'src/color.c')
-rw-r--r--src/color.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/color.c b/src/color.c
index 98fe9f2..94fcac8 100644
--- a/src/color.c
+++ b/src/color.c
@@ -877,6 +877,10 @@ static int cbuff(CFILE *cfile, const char *format, ...);
/** Dump a parsed expression tree, for debugging. */
static int print_expr(CFILE *cfile, const struct bfs_expr *expr, bool verbose) {
+ if (!expr) {
+ return dstrcat(&cfile->buffer, "(null)");
+ }
+
if (dstrcat(&cfile->buffer, "(") != 0) {
return -1;
}