From: kgv Date: Wed, 20 Mar 2013 11:06:32 +0000 (+0400) Subject: 0023842: Undefined behavior: Variable 'thePsFont' is used as parameter and destinatio... X-Git-Tag: V6_6_0_beta~12 X-Git-Url: http://git.dev.opencascade.org/gitweb/?a=commitdiff_plain;h=8b224a099294329284faa70ff56e9b4b2807bd8c;p=occt.git 0023842: Undefined behavior: Variable 'thePsFont' is used as parameter and destination in s[n]printf() --- 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)