use BLI_strncpy and BLI_snprintf when the size of the string is known.
[blender-staging.git] / source / blender / editors / space_graph / graph_buttons.c
index c1dfa97a5088e2a8b02c72bb7d975af51c95058f..9e1ff82c20d32e4cc29eb11eaf3982e762cf76df 100644 (file)
@@ -647,7 +647,7 @@ static void graph_panel_drivers(const bContext *C, Panel *pa)
                        
                        uiItemL(row, "Driver Value:", ICON_NONE);
                        
-                       sprintf(valBuf, "%.3f", driver->curval);
+                       BLI_snprintf(valBuf, sizeof(valBuf), "%.3f", driver->curval);
                        uiItemL(row, valBuf, ICON_NONE);
                }
        
@@ -702,18 +702,18 @@ static void graph_panel_drivers(const bContext *C, Panel *pa)
                                        graph_panel_driverVar__transChan(box, ale->id, dvar);
                                        break;
                        }
-                       
-               /* value of variable */
-               if (driver->flag & DRIVER_FLAG_SHOWDEBUG) {
-                       char valBuf[32];
-                       
-                       box= uiLayoutBox(col);
-                       row= uiLayoutRow(box, 1);
+
+                       /* value of variable */
+                       if (driver->flag & DRIVER_FLAG_SHOWDEBUG) {
+                               char valBuf[32];
+
+                               box= uiLayoutBox(col);
+                               row= uiLayoutRow(box, 1);
                                uiItemL(row, "Value:", ICON_NONE);
                                
-                               sprintf(valBuf, "%.3f", dvar->curval);
+                               BLI_snprintf(valBuf, sizeof(valBuf), "%.3f", dvar->curval);
                                uiItemL(row, valBuf, ICON_NONE);
-               }
+                       }
        }
        
        /* cleanup */