[Bf-blender-cvs] [f351cb54792] master: Avoid platform dependant PATH_MAX

Campbell Barton noreply at git.blender.org
Wed Apr 26 13:05:16 CEST 2017


Commit: f351cb547929e7be92651d579d96e8a4ab944fc6
Author: Campbell Barton
Date:   Wed Apr 26 21:06:00 2017 +1000
Branches: master
https://developer.blender.org/rBf351cb547929e7be92651d579d96e8a4ab944fc6

Avoid platform dependant PATH_MAX

===================================================================

M	source/blender/alembic/intern/alembic_capi.cc
M	source/blender/makesdna/DNA_cachefile_types.h

===================================================================

diff --git a/source/blender/alembic/intern/alembic_capi.cc b/source/blender/alembic/intern/alembic_capi.cc
index 50e7626ad1e..15f3d1ff6ea 100644
--- a/source/blender/alembic/intern/alembic_capi.cc
+++ b/source/blender/alembic/intern/alembic_capi.cc
@@ -172,7 +172,7 @@ static bool gather_objects_paths(const IObject &object, ListBase *object_paths)
 		void *abc_path_void = MEM_callocN(sizeof(AlembicObjectPath), "AlembicObjectPath");
 		AlembicObjectPath *abc_path = static_cast<AlembicObjectPath *>(abc_path_void);
 
-		BLI_strncpy(abc_path->path, object.getFullName().c_str(), PATH_MAX);
+		BLI_strncpy(abc_path->path, object.getFullName().c_str(), sizeof(abc_path->path));
 		BLI_addtail(object_paths, abc_path);
 	}
 
@@ -542,7 +542,7 @@ static std::pair<bool, AbcObjectReader *> visit_object(
 
 		AlembicObjectPath *abc_path = static_cast<AlembicObjectPath *>(
 		                                  MEM_callocN(sizeof(AlembicObjectPath), "AlembicObjectPath"));
-		BLI_strncpy(abc_path->path, full_name.c_str(), PATH_MAX);
+		BLI_strncpy(abc_path->path, full_name.c_str(), sizeof(abc_path->path));
 		BLI_addtail(&settings.cache_file->object_paths, abc_path);
 
 		/* We can now assign this reader as parent for our children. */
diff --git a/source/blender/makesdna/DNA_cachefile_types.h b/source/blender/makesdna/DNA_cachefile_types.h
index 86940209089..a353c94ae64 100644
--- a/source/blender/makesdna/DNA_cachefile_types.h
+++ b/source/blender/makesdna/DNA_cachefile_types.h
@@ -52,7 +52,7 @@ enum {
 typedef struct AlembicObjectPath {
 	struct AlembicObjectPath *next, *prev;
 
-	char path[4096];  /* 4096 = PATH_MAX */
+	char path[4096];
 } AlembicObjectPath;
 
 typedef struct CacheFile {




More information about the Bf-blender-cvs mailing list