Use correct length for strncmp comparison

This commit is contained in:
Carl Smedstad 2022-12-30 10:35:25 +01:00
parent 7a19381649
commit 4d2c842ea3
No known key found for this signature in database
GPG key ID: 5EED78D7F779E010

View file

@ -292,7 +292,7 @@ static uint32_t render_status_block(struct render_context *ctx,
}
double offset = 0;
if (strncmp(block->align, "left", 5) == 0) {
if (strncmp(block->align, "left", 4) == 0) {
offset = x_pos;
} else if (strncmp(block->align, "right", 5) == 0) {
offset = x_pos + width - text_width;