From c4bacda162b4421f92c613365ffe6565c2ef3040 Mon Sep 17 00:00:00 2001 From: Peter Johanson <peter@peterjohanson.com> Date: Fri, 20 Sep 2024 16:37:10 -0600 Subject: [PATCH] fix(display): Check layer name length too. --- app/boards/arm/corneish_zen/widgets/layer_status.c | 2 +- app/src/display/widgets/layer_status.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/boards/arm/corneish_zen/widgets/layer_status.c b/app/boards/arm/corneish_zen/widgets/layer_status.c index 82de72c99fd..002ce46b48d 100644 --- a/app/boards/arm/corneish_zen/widgets/layer_status.c +++ b/app/boards/arm/corneish_zen/widgets/layer_status.c @@ -27,7 +27,7 @@ static void set_layer_symbol(lv_obj_t *label, struct layer_status_state state) { const char *layer_label = state.label; zmk_keymap_layer_index_t active_layer_index = state.index; - if (layer_label == NULL) { + if (layer_label == NULL || strlen(layer_label) == 0) { char text[6] = {}; sprintf(text, " %i", active_layer_index); diff --git a/app/src/display/widgets/layer_status.c b/app/src/display/widgets/layer_status.c index d341ccd3223..64cb7c3d599 100644 --- a/app/src/display/widgets/layer_status.c +++ b/app/src/display/widgets/layer_status.c @@ -23,7 +23,7 @@ struct layer_status_state { }; static void set_layer_symbol(lv_obj_t *label, struct layer_status_state state) { - if (state.label == NULL) { + if (state.label == NULL || strlen(state.label) == 0) { char text[8] = {}; snprintf(text, sizeof(text), LV_SYMBOL_KEYBOARD " %i", state.index);