Ver Fonte

`LoadFontDefault()`: Initialize glyphs and recs to zero #4319

Ray há 11 meses atrás
pai
commit
1eb8ff5e54
1 ficheiros alterados com 2 adições e 2 exclusões
  1. 2 2
      src/rtext.c

+ 2 - 2
src/rtext.c

@@ -260,8 +260,8 @@ extern void LoadFontDefault(void)
 
     // Allocate space for our characters info data
     // NOTE: This memory must be freed at end! --> Done by CloseWindow()
-    defaultFont.glyphs = (GlyphInfo *)RL_MALLOC(defaultFont.glyphCount*sizeof(GlyphInfo));
-    defaultFont.recs = (Rectangle *)RL_MALLOC(defaultFont.glyphCount*sizeof(Rectangle));
+    defaultFont.glyphs = (GlyphInfo *)RL_CALLOC(defaultFont.glyphCount, sizeof(GlyphInfo));
+    defaultFont.recs = (Rectangle *)RL_CALLOC(defaultFont.glyphCount, sizeof(Rectangle));
 
     int currentLine = 0;
     int currentPosX = charsDivisor;