diff options
author | Campbell Barton <ideasman42@gmail.com> | 2010-04-15 20:44:38 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2010-04-15 20:44:38 +0400 |
commit | 15010c01ae8d82ca18e3681be2e189e14a186d49 (patch) | |
tree | 012ca425b06beb17469c734ca2c4e9386c45eee2 | |
parent | cf2287a27cc81b44b293ebde4d8b16c93ea81e10 (diff) |
fix for crash when drawing fps
-rw-r--r-- | source/blender/editors/space_view3d/view3d_draw.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/source/blender/editors/space_view3d/view3d_draw.c b/source/blender/editors/space_view3d/view3d_draw.c index e2b579734d3..a843aa746b6 100644 --- a/source/blender/editors/space_view3d/view3d_draw.c +++ b/source/blender/editors/space_view3d/view3d_draw.c @@ -2158,15 +2158,15 @@ static void draw_viewport_fps(Scene *scene, ARegion *ar) fps = fps / tot; } #endif - + /* is this more then half a frame behind? */ if (fps+0.5 < FPS) { UI_ThemeColor(TH_REDALERT); - sprintf(printable, "fps: %.2f", (float)fps); + snprintf(printable, sizeof(printable), "fps: %.2f", (float)fps); } else { UI_ThemeColor(TH_TEXT_HI); - sprintf(printable, "fps: %i", (int)(fps+0.5)); + snprintf(printable, sizeof(printable), "fps: %i", (int)(fps+0.5)); } BLF_draw_default(22, ar->winy-17, 0.0f, printable); |