From fccc6a2922ddfe9d8eae22b53f50ffb14a94b623 Mon Sep 17 00:00:00 2001 From: John Lindgren Date: Tue, 16 Apr 2024 20:45:16 -0400 Subject: [PATCH] common/buf: use string_null_or_empty() --- src/common/buf.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/common/buf.c b/src/common/buf.c index 849e0df7..78d48d15 100644 --- a/src/common/buf.c +++ b/src/common/buf.c @@ -6,6 +6,7 @@ #include "common/buf.h" #include "common/macros.h" #include "common/mem.h" +#include "common/string-helpers.h" void buf_expand_tilde(struct buf *s) @@ -97,7 +98,7 @@ buf_expand(struct buf *s, int new_alloc) void buf_add(struct buf *s, const char *data) { - if (!data || data[0] == '\0') { + if (string_null_or_empty(data)) { return; } int len = strlen(data);