diff options
author | Campbell Barton <ideasman42@gmail.com> | 2011-02-13 06:21:27 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2011-02-13 06:21:27 +0300 |
commit | 867fc4b463ef39ea16103f18f332c3d259624d29 (patch) | |
tree | 7d20c416241afb7b878b767a9955e284d3cddbe2 /source/blender/blenkernel/intern/deform.c | |
parent | 9e03a0d4762b4734fe7ccb20e03b4a3c8f939620 (diff) |
enforce string limits (reported by pedantic checking tools & some developers).
mostly replace strcpy with BLI_strncpy and multiple strcat's with a BLI_snprintf().
also fix possible crash if CWD isnt available.
Diffstat (limited to 'source/blender/blenkernel/intern/deform.c')
-rw-r--r-- | source/blender/blenkernel/intern/deform.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/source/blender/blenkernel/intern/deform.c b/source/blender/blenkernel/intern/deform.c index 1b63e4fd5d1..2014dfe6d0a 100644 --- a/source/blender/blenkernel/intern/deform.c +++ b/source/blender/blenkernel/intern/deform.c @@ -348,20 +348,20 @@ void flip_side_name (char *name, const char *from_name, int strip_number) len= strlen(from_name); if(len<3) return; // we don't do names like .R or .L - strcpy(name, from_name); + BLI_strncpy(name, from_name, sizeof(name)); /* We first check the case with a .### extension, let's find the last period */ if(isdigit(name[len-1])) { index= strrchr(name, '.'); // last occurrence if (index && isdigit(index[1]) ) { // doesnt handle case bone.1abc2 correct..., whatever! if(strip_number==0) - strcpy(number, index); + BLI_strncpy(number, index, sizeof(number)); *index= 0; len= strlen(name); } } - strcpy (prefix, name); + BLI_strncpy(prefix, name, sizeof(prefix)); #define IS_SEPARATOR(a) ((a)=='.' || (a)==' ' || (a)=='-' || (a)=='_') |