From e10fd04db0bdcdbc326fce6cddc8af1179a5de5c Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Wed, 11 Jan 2012 12:33:51 +0000 Subject: use BLI_strncpy and BLI_snprintf when the size of the string is known. fix for sequencer unique naming which was missed with string length update. --- source/blender/editors/curve/editcurve.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'source/blender/editors/curve') diff --git a/source/blender/editors/curve/editcurve.c b/source/blender/editors/curve/editcurve.c index 762564c1cc9..85ddc7ef14e 100644 --- a/source/blender/editors/curve/editcurve.c +++ b/source/blender/editors/curve/editcurve.c @@ -1069,17 +1069,17 @@ static void curve_rename_fcurves(Object *obedit, ListBase *orig_curves) while (a--) { keyIndex= getCVKeyIndex(editnurb, bezt); if(keyIndex) { - sprintf(rna_path, "splines[%d].bezier_points[%d]", nu_index, pt_index); - sprintf(orig_rna_path, "splines[%d].bezier_points[%d]", keyIndex->nu_index, keyIndex->pt_index); + BLI_snprintf(rna_path, sizeof(rna_path), "splines[%d].bezier_points[%d]", nu_index, pt_index); + BLI_snprintf(orig_rna_path, sizeof(orig_rna_path), "splines[%d].bezier_points[%d]", keyIndex->nu_index, keyIndex->pt_index); if(keyIndex->switched) { char handle_path[64], orig_handle_path[64]; - sprintf(orig_handle_path, "%s.handle_left", orig_rna_path); - sprintf(handle_path, "%s.handle_right", rna_path); + BLI_snprintf(orig_handle_path, sizeof(orig_rna_path), "%s.handle_left", orig_rna_path); + BLI_snprintf(handle_path, sizeof(rna_path), "%s.handle_right", rna_path); fcurve_path_rename(ad, orig_handle_path, handle_path, orig_curves, &curves); - sprintf(orig_handle_path, "%s.handle_right", orig_rna_path); - sprintf(handle_path, "%s.handle_left", rna_path); + BLI_snprintf(orig_handle_path, sizeof(orig_rna_path), "%s.handle_right", orig_rna_path); + BLI_snprintf(handle_path, sizeof(rna_path), "%s.handle_left", rna_path); fcurve_path_rename(ad, orig_handle_path, handle_path, orig_curves, &curves); } @@ -1100,8 +1100,8 @@ static void curve_rename_fcurves(Object *obedit, ListBase *orig_curves) while (a--) { keyIndex= getCVKeyIndex(editnurb, bp); if(keyIndex) { - sprintf(rna_path, "splines[%d].points[%d]", nu_index, pt_index); - sprintf(orig_rna_path, "splines[%d].points[%d]", keyIndex->nu_index, keyIndex->pt_index); + BLI_snprintf(rna_path, sizeof(rna_path), "splines[%d].points[%d]", nu_index, pt_index); + BLI_snprintf(orig_rna_path, sizeof(orig_rna_path), "splines[%d].points[%d]", keyIndex->nu_index, keyIndex->pt_index); fcurve_path_rename(ad, orig_rna_path, rna_path, orig_curves, &curves); keyIndex->nu_index= nu_index; @@ -1140,8 +1140,8 @@ static void curve_rename_fcurves(Object *obedit, ListBase *orig_curves) } if(keyIndex) { - sprintf(rna_path, "splines[%d]", nu_index); - sprintf(orig_rna_path, "splines[%d]", keyIndex->nu_index); + BLI_snprintf(rna_path, sizeof(rna_path), "splines[%d]", nu_index); + BLI_snprintf(orig_rna_path, sizeof(orig_rna_path), "splines[%d]", keyIndex->nu_index); fcurve_path_rename(ad, orig_rna_path, rna_path, orig_curves, &curves); } -- cgit v1.2.3