From 9b5904e7dc349ad49bbf38d47d4dd0c6fcaba811 Mon Sep 17 00:00:00 2001 From: Dave T <17680170+davet2001@users.noreply.github.com> Date: Fri, 11 Oct 2024 18:55:13 +0000 Subject: [PATCH] Resolve clang-tidy issue --- esphome/components/display/display.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/esphome/components/display/display.cpp b/esphome/components/display/display.cpp index 76d0c2c851..8ec7f734fa 100644 --- a/esphome/components/display/display.cpp +++ b/esphome/components/display/display.cpp @@ -496,6 +496,7 @@ void Display::printf(int x, int y, int width, int height, BaseFont *font, float char buffer[256]; int ret = vsnprintf(buffer, sizeof(buffer), format, arg); + va_end(arg); if (ret == 0) return; @@ -555,8 +556,6 @@ void Display::printf(int x, int y, int width, int height, BaseFont *font, float if (!line.empty()) { this->printf(x, line_y, font, align, "%s", line.c_str()); } - - va_end(arg); } void Display::set_writer(display_writer_t &&writer) { this->writer_ = writer; }