mirror of
https://github.com/labwc/labwc.git
synced 2025-11-04 13:30:07 -05:00
string-helpers.c: add string_empty()
This commit is contained in:
parent
8c9be2f0d1
commit
c066821046
9 changed files with 27 additions and 14 deletions
|
|
@ -7,6 +7,7 @@
|
|||
#include <wlr/util/log.h>
|
||||
#include "common/font.h"
|
||||
#include "common/graphic-helpers.h"
|
||||
#include "common/string-helpers.h"
|
||||
#include "labwc.h"
|
||||
#include "buffer.h"
|
||||
|
||||
|
|
@ -84,7 +85,7 @@ font_buffer_create(struct lab_data_buffer **buffer, int max_width,
|
|||
max_width = 2;
|
||||
}
|
||||
|
||||
if (!text || !*text) {
|
||||
if (string_null_or_empty(text)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -6,6 +6,12 @@
|
|||
#include "common/mem.h"
|
||||
#include "common/string-helpers.h"
|
||||
|
||||
bool
|
||||
string_null_or_empty(const char *s)
|
||||
{
|
||||
return !s || !*s;
|
||||
}
|
||||
|
||||
void
|
||||
trim_last_field(char *buf, char delim)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue