0023842: Undefined behavior: Variable 'thePsFont' is used as parameter and destinatio...
[occt.git] / 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)