Skip to content

Commit

Permalink
fix(display): Check layer name length too.
Browse files Browse the repository at this point in the history
  • Loading branch information
petejohanson committed Sep 21, 2024
1 parent cca637d commit 11f600d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/boards/arm/corneish_zen/widgets/layer_status.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion app/src/display/widgets/layer_status.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 11f600d

Please sign in to comment.