From 51df06523e41d1487b8b36c840509e4627363c7b Mon Sep 17 00:00:00 2001 From: Thierry Crozat Date: Fri, 6 Oct 2017 00:57:41 +0100 Subject: KYRA: Fix undefined behaviour in variadic functions Passing a type that undergoes default argument promotion as last argument of a variadic function results in undefined behaviour. --- engines/kyra/screen_lol.cpp | 4 ++-- engines/kyra/screen_lol.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'engines/kyra') diff --git a/engines/kyra/screen_lol.cpp b/engines/kyra/screen_lol.cpp index 6dd6080923..2531cb4cb1 100644 --- a/engines/kyra/screen_lol.cpp +++ b/engines/kyra/screen_lol.cpp @@ -54,7 +54,7 @@ Screen_LoL::~Screen_LoL() { delete[] _grayOverlay; } -void Screen_LoL::fprintString(const char *format, int x, int y, uint8 col1, uint8 col2, uint16 flags, ...) { +void Screen_LoL::fprintString(const char *format, int x, int y, uint8 col1, uint8 col2, uint flags, ...) { if (!format) return; @@ -90,7 +90,7 @@ void Screen_LoL::fprintString(const char *format, int x, int y, uint8 col1, uint printText(string, x, y, col1, col2); } -void Screen_LoL::fprintStringIntro(const char *format, int x, int y, uint8 c1, uint8 c2, uint8 c3, uint16 flags, ...) { +void Screen_LoL::fprintStringIntro(const char *format, int x, int y, uint8 c1, uint8 c2, uint8 c3, uint flags, ...) { char buffer[400]; va_list args; diff --git a/engines/kyra/screen_lol.h b/engines/kyra/screen_lol.h index 91d663d34f..49c6f90168 100644 --- a/engines/kyra/screen_lol.h +++ b/engines/kyra/screen_lol.h @@ -36,8 +36,8 @@ public: Screen_LoL(LoLEngine *vm, OSystem *system); ~Screen_LoL(); - void fprintString(const char *format, int x, int y, uint8 col1, uint8 col2, uint16 flags, ...) GCC_PRINTF(2, 8); - void fprintStringIntro(const char *format, int x, int y, uint8 c1, uint8 c2, uint8 c3, uint16 flags, ...) GCC_PRINTF(2, 9); + void fprintString(const char *format, int x, int y, uint8 col1, uint8 col2, uint flags, ...) GCC_PRINTF(2, 8); + void fprintStringIntro(const char *format, int x, int y, uint8 c1, uint8 c2, uint8 c3, uint flags, ...) GCC_PRINTF(2, 9); void drawShadedBox(int x1, int y1, int x2, int y2, int color1, int color2); -- cgit v1.2.3