0023842: Undefined behavior: Variable 'thePsFont' is used as parameter and destinatio...
authorkgv <kgv@opencascade.com>
Wed, 20 Mar 2013 11:06:32 +0000 (15:06 +0400)
committerkgv <kgv@opencascade.com>
Fri, 22 Mar 2013 12:48:34 +0000 (16:48 +0400)
src/OpenGl/OpenGl_Text.cxx

index a75be7b..cc89d9b 100644 (file)
@@ -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)