From 8b224a099294329284faa70ff56e9b4b2807bd8c Mon Sep 17 00:00:00 2001 From: kgv Date: Wed, 20 Mar 2013 15:06:32 +0400 Subject: [PATCH] 0023842: Undefined behavior: Variable 'thePsFont' is used as parameter and destination in s[n]printf() --- src/OpenGl/OpenGl_Text.cxx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/OpenGl/OpenGl_Text.cxx b/src/OpenGl/OpenGl_Text.cxx index a75be7b250..cc89d9b5ab 100644 --- a/src/OpenGl/OpenGl_Text.cxx +++ b/src/OpenGl/OpenGl_Text.cxx @@ -90,10 +90,13 @@ namespace if (isBold) { - sprintf (thePsFont, "%s-%s", TheFamily[aFontId], "Bold"); if (isItalic) { - sprintf (thePsFont, "%s%s", thePsFont, TheItalic[aFontId]); + sprintf (thePsFont, "%s-Bold%s", TheFamily[aFontId], TheItalic[aFontId]); + } + else + { + sprintf (thePsFont, "%s-Bold", TheFamily[aFontId]); } } else if (isItalic)