diff --git a/src/parser_utils.c b/src/parser_utils.c index a00bc28d..e88d19fb 100644 --- a/src/parser_utils.c +++ b/src/parser_utils.c @@ -424,6 +424,8 @@ void fixupEncodedHeaderLine(char *buf, int buflen){ } if(need_encoding == 1 && ret == OK){ + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wstringop-truncation" strncat(puf, tmpbuf, sizeof(puf)-strlen(puf)-1); } else { diff --git a/unit_tests/check_parser_utils.c b/unit_tests/check_parser_utils.c index 0f98f9ca..5611fe12 100644 --- a/unit_tests/check_parser_utils.c +++ b/unit_tests/check_parser_utils.c @@ -25,6 +25,7 @@ struct str_pair { static void test_parse_date_header(){ unsigned int i; struct config cfg; + time_t delta; struct date_test date_test[] = { {"Date: Mon, 02 Nov 2015 09:39:31 -0000", 1446457171}, {"Date: Mon, 2 Nov 2015 10:39:45 +0100", 1446457185}, @@ -48,7 +49,8 @@ static void test_parse_date_header(){ TEST_HEADER(); for(i=0; i= -3600, date_test[i].date_str); } TEST_FOOTER();