Commit: a996f90f3a25c4f52f65d32d914a4a210f99afc0
Parent: 9b257bd5d4d939a6f3fe338f237d6433b715d006
Author: Randy Palamar
Date: Fri, 20 Oct 2023 09:38:01 -0600
script: avoid printing empty blocks
Diffstat:
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/blocks/script.c b/blocks/script.c
@@ -18,5 +18,5 @@ script(struct Block *b)
buf[strcspn(buf, "\n")] = 0;
pclose(fp);
- return snprintf(b->curstr, LEN(b->curstr), b->fmt, buf);
+ return buf[0]? snprintf(b->curstr, LEN(b->curstr), b->fmt, buf) : 0;
}