From 06f000d9da8d7a8a7496aa1e74d827157114526f Mon Sep 17 00:00:00 2001 From: Brenden Matthews Date: Sat, 18 Feb 2023 08:33:11 -0500 Subject: [PATCH] Enable GCC 12 in actions, fix warning. (#1407) * Enable GCC 12 in actions, fix warning. This resolves #1406. --- .github/workflows/build-and-test-linux.yaml | 3 ++- src/scroll.cc | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-and-test-linux.yaml b/.github/workflows/build-and-test-linux.yaml index f0cf4c78..701b8d2c 100644 --- a/.github/workflows/build-and-test-linux.yaml +++ b/.github/workflows/build-and-test-linux.yaml @@ -29,7 +29,8 @@ jobs: - 13 - 14 exclude: - - compiler: gcc + - os: ubuntu-20.04 + compiler: gcc compiler_version: 12 - compiler: gcc compiler_version: 13 diff --git a/src/scroll.cc b/src/scroll.cc index 46166024..b26f5025 100644 --- a/src/scroll.cc +++ b/src/scroll.cc @@ -27,9 +27,9 @@ * */ #include +#include "colours.h" #include "conky.h" #include "core.h" -#include "colours.h" #include "display-output.hh" #include "logging.h" #include "specials.h" @@ -190,7 +190,7 @@ void parse_scroll_arg(struct text_object *obj, const char *arg, sd->text[0] = 0; } - strncat(sd->text, arg + n1, strlen(arg + n1)); + strncat(sd->text, arg + n1, max_user_text.get(*state) - n1); sd->start = sd->direction == SCROLL_WAIT ? strlen(sd->text) : 0; obj->sub = static_cast(malloc(sizeof(struct text_object)));