aboutsummaryrefslogtreecommitdiffstats
path: root/sway/tree/container.c
diff options
context:
space:
mode:
authorLibravatar Simon Ser <contact@emersion.fr>2022-02-08 09:52:24 +0100
committerLibravatar Simon Zeni <simon@bl4ckb0ne.ca>2022-02-08 09:20:13 -0500
commitf707f583e17cb5e8323ceb4bfd951ad0465b7d10 (patch)
tree9de2eaecf63cb4f8e1c0af7ba1c7c9d7a8fd01a4 /sway/tree/container.c
parentFix snprintf compiler warning (diff)
downloadsway-f707f583e17cb5e8323ceb4bfd951ad0465b7d10.tar.gz
sway-f707f583e17cb5e8323ceb4bfd951ad0465b7d10.tar.zst
sway-f707f583e17cb5e8323ceb4bfd951ad0465b7d10.zip
Remove all sprintf calls
Replace them with snprintf, which ensures buffer overflows won't happen.
Diffstat (limited to 'sway/tree/container.c')
-rw-r--r--sway/tree/container.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sway/tree/container.c b/sway/tree/container.c
index 527759ba..09766ce5 100644
--- a/sway/tree/container.c
+++ b/sway/tree/container.c
@@ -1706,7 +1706,7 @@ static void update_marks_texture(struct sway_container *con,
1706 for (int i = 0; i < con->marks->length; ++i) { 1706 for (int i = 0; i < con->marks->length; ++i) {
1707 char *mark = con->marks->items[i]; 1707 char *mark = con->marks->items[i];
1708 if (mark[0] != '_') { 1708 if (mark[0] != '_') {
1709 sprintf(part, "[%s]", mark); 1709 snprintf(part, len + 1, "[%s]", mark);
1710 strcat(buffer, part); 1710 strcat(buffer, part);
1711 } 1711 }
1712 } 1712 }