]> git.mdlowis.com Git - proto/labwc.git/commitdiff
common/buf: use string_null_or_empty()
authorJohn Lindgren <john@jlindgren.net>
Wed, 17 Apr 2024 00:45:16 +0000 (20:45 -0400)
committerJohan Malm <johanmalm@users.noreply.github.com>
Thu, 18 Apr 2024 06:00:23 +0000 (07:00 +0100)
src/common/buf.c

index 849e0df754ddabc1ed46f3a04cf24ae15bda2536..78d48d150514aaadd25603d934acebab823dd06b 100644 (file)
@@ -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);