small asan fixes

This commit is contained in:
Felix Kratz 2022-12-23 23:00:11 +01:00
parent 22572e8224
commit 37dd382770
3 changed files with 5 additions and 5 deletions

View file

@ -65,7 +65,7 @@ void bar_item_append_associated_space(struct bar_item* bar_item, uint32_t bit) {
if (bar_item->type == BAR_COMPONENT_SPACE) {
bar_item->associated_space = bit;
char sid_str[32];
sprintf(sid_str, "%u", get_set_bit_position(bit));
snprintf(sid_str, 32, "%u", get_set_bit_position(bit));
env_vars_set(&bar_item->signal_args.env_vars,
string_copy("SID"),
string_copy(sid_str) );
@ -79,7 +79,7 @@ void bar_item_append_associated_display(struct bar_item* bar_item, uint32_t bit)
bar_item->overrides_association = true;
bar_item->associated_display = bit;
char did_str[32];
sprintf(did_str, "%u", get_set_bit_position(bit));
snprintf(did_str, 32, "%u", get_set_bit_position(bit));
env_vars_set(&bar_item->signal_args.env_vars,
string_copy("DID"),
string_copy(did_str) );

View file

@ -454,7 +454,7 @@ void bar_manager_update_space_components(struct bar_manager* bar_manager, bool f
bar_item->drawing = true;
}
else {
bar_item->associated_display = 1 << 31;
bar_item->associated_display = 1 << 30;
bar_item->drawing = false;
}
}

View file

@ -80,8 +80,8 @@ static void text_prepare_line(struct text* text) {
text->bounds.size.width = (uint32_t) (text->bounds.size.width + 1.5);
text->bounds.size.height = (uint32_t) (text->bounds.size.height + 1.5);
text->bounds.origin.x = (uint32_t) (text->bounds.origin.x + 0.5);
text->bounds.origin.y = (uint32_t) (text->bounds.origin.y + 0.5);
text->bounds.origin.x = (int32_t) (text->bounds.origin.x + 0.5);
text->bounds.origin.y = (int32_t) (text->bounds.origin.y + 0.5);
text->line.color = text->highlight ? text->highlight_color : text->color;
CFRelease(string);