diff options
author | Campbell Barton <ideasman42@gmail.com> | 2010-07-04 21:14:06 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2010-07-04 21:14:06 +0400 |
commit | 15de21e43807620801f07e5ebf87ab74a4a40636 (patch) | |
tree | 9ffd6cffb16027ba7af0f6fe4c046e864e69f1e2 /source/blender/blenlib | |
parent | 574d3076356d94740681d23657cecee1ece26d3f (diff) |
fix for 2 bugs in own recent commits,
- 29881 broke BLI_stringdec in some cases.
- poll function for view home crashed view menu because the rv3d isnt available (still needs fixing).
Diffstat (limited to 'source/blender/blenlib')
-rw-r--r-- | source/blender/blenlib/intern/path_util.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/source/blender/blenlib/intern/path_util.c b/source/blender/blenlib/intern/path_util.c index ce787c6b114..a3c0f994c05 100644 --- a/source/blender/blenlib/intern/path_util.c +++ b/source/blender/blenlib/intern/path_util.c @@ -105,12 +105,18 @@ int BLI_stringdec(const char *string, char *head, char *tail, unsigned short *nu } if (found) { if (tail) strcpy(tail, &string[nume+1]); - if (head) BLI_strncpy(head, string, nums); + if (head) { + strcpy(head,string); + head[nums]=0; + } if (numlen) *numlen = nume-nums+1; return ((int)atoi(&(string[nums]))); } if (tail) strcpy(tail, string + len); - if (head) BLI_strncpy(head, string, nums); + if (head) { + strncpy(head, string, len); + head[len] = '\0'; + } if (numlen) *numlen=0; return 0; } |