diff options
author | Campbell Barton <ideasman42@gmail.com> | 2010-11-05 10:35:21 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2010-11-05 10:35:21 +0300 |
commit | e179c92a278160ad3a1523a17ef272f6f3547f46 (patch) | |
tree | 743ba7ec0ac67b6afc202cdd7a5d063d6ee617ae /source/blender/blenkernel/intern/font.c | |
parent | 0ebdbdac00fda4ceb7f8a53e3b944575a8d76133 (diff) |
tedious string copying changes
- use sizeof() in more places.
- fixed some off by 1 bugs copying strings. setting curve font family for instance was 1 char too short.
- replace strncpy and strcpy with BLI_strncpy
Diffstat (limited to 'source/blender/blenkernel/intern/font.c')
-rw-r--r-- | source/blender/blenkernel/intern/font.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/source/blender/blenkernel/intern/font.c b/source/blender/blenkernel/intern/font.c index 0b27aaeb0ba..5fdb9549179 100644 --- a/source/blender/blenkernel/intern/font.c +++ b/source/blender/blenkernel/intern/font.c @@ -394,7 +394,7 @@ VFont *load_vfont(char *name) /* if there's a font name, use it for the ID name */ if (strcmp(vfd->name, "")!=0) { - BLI_strncpy(vfont->id.name+2, vfd->name, 21); + BLI_strncpy(vfont->id.name+2, vfd->name, sizeof(vfont->id.name)-2); } BLI_strncpy(vfont->name, name, sizeof(vfont->name)); |