Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2010-07-04 21:14:06 +0400
committerCampbell Barton <ideasman42@gmail.com>2010-07-04 21:14:06 +0400
commit15de21e43807620801f07e5ebf87ab74a4a40636 (patch)
tree9ffd6cffb16027ba7af0f6fe4c046e864e69f1e2 /source
parent574d3076356d94740681d23657cecee1ece26d3f (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')
-rw-r--r--source/blender/blenlib/intern/path_util.c10
-rw-r--r--source/blender/editors/space_view3d/view3d_edit.c4
2 files changed, 10 insertions, 4 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;
}
diff --git a/source/blender/editors/space_view3d/view3d_edit.c b/source/blender/editors/space_view3d/view3d_edit.c
index 82cba7759ca..56714143fe9 100644
--- a/source/blender/editors/space_view3d/view3d_edit.c
+++ b/source/blender/editors/space_view3d/view3d_edit.c
@@ -1309,8 +1309,8 @@ static int viewhome_exec(bContext *C, wmOperator *op) /* was view3d_home() in 2.
static int viewhome_poll(bContext *C)
{
if(ED_operator_view3d_active(C)) {
- RegionView3D *rv3d= CTX_wm_region_view3d(C);
- if(rv3d->persp!=RV3D_CAMOB) {
+ RegionView3D *rv3d= CTX_wm_region_view3d(C); //XXX, when accessed from a header menu this doesnt work!
+ if(rv3d && rv3d->persp!=RV3D_CAMOB) {
return 1;
}
}