aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar Carl Smedstad <carl.smedstad@protonmail.com>2022-12-30 10:35:25 +0100
committerLibravatar Simon Ser <contact@emersion.fr>2023-02-10 18:11:02 +0100
commitd7158ab9843a6cf056e60357527ab7bd437da6f8 (patch)
tree23dbf75280fa022b4c461a2c229c2455e2173299
parentman: fix typo in output disable docs (diff)
downloadsway-d7158ab9843a6cf056e60357527ab7bd437da6f8.tar.gz
sway-d7158ab9843a6cf056e60357527ab7bd437da6f8.tar.zst
sway-d7158ab9843a6cf056e60357527ab7bd437da6f8.zip
Use correct length for strncmp comparison
(cherry picked from commit 714559812e222f988e18a52ffecd8dcaf9604ad5)
-rw-r--r--swaybar/render.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/swaybar/render.c b/swaybar/render.c
index 95f6e5be..ccf36563 100644
--- a/swaybar/render.c
+++ b/swaybar/render.c
@@ -292,7 +292,7 @@ static uint32_t render_status_block(struct render_context *ctx,
292 } 292 }
293 293
294 double offset = 0; 294 double offset = 0;
295 if (strncmp(block->align, "left", 5) == 0) { 295 if (strncmp(block->align, "left", 4) == 0) {
296 offset = x_pos; 296 offset = x_pos;
297 } else if (strncmp(block->align, "right", 5) == 0) { 297 } else if (strncmp(block->align, "right", 5) == 0) {
298 offset = x_pos + width - text_width; 298 offset = x_pos + width - text_width;