Avoid platform dependant PATH_MAX
authorCampbell Barton <ideasman42@gmail.com>
Wed, 26 Apr 2017 11:06:00 +0000 (21:06 +1000)
committerCampbell Barton <ideasman42@gmail.com>
Wed, 26 Apr 2017 11:06:00 +0000 (21:06 +1000)
source/blender/alembic/intern/alembic_capi.cc
source/blender/makesdna/DNA_cachefile_types.h

index 50e7626ad1e7e7af5e901a6797f500c18d5b922b..15f3d1ff6ea156c37a8950db7a73861d82d7f597 100644 (file)
@@ -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. */
index 869402090897cb211b7d62a95eda932e840a0856..a353c94ae64d8b87a9feb2b0fbb2197a69455ee2 100644 (file)
@@ -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 {