[Bf-blender-cvs] [1276d0024fb] master: Cleanup: specify array sizes, remove warnings in comments

Campbell Barton noreply at git.blender.org
Thu May 27 10:00:39 CEST 2021


Commit: 1276d0024fb66825ec219ba742187cfcf338cbd2
Author: Campbell Barton
Date:   Thu May 27 17:12:38 2021 +1000
Branches: master
https://developer.blender.org/rB1276d0024fb66825ec219ba742187cfcf338cbd2

Cleanup: specify array sizes, remove warnings in comments

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

M	source/blender/editors/space_file/file_ops.c

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

diff --git a/source/blender/editors/space_file/file_ops.c b/source/blender/editors/space_file/file_ops.c
index 61f3c046550..36f8476d0c9 100644
--- a/source/blender/editors/space_file/file_ops.c
+++ b/source/blender/editors/space_file/file_ops.c
@@ -2263,23 +2263,24 @@ void FILE_OT_filepath_drop(wmOperatorType *ot)
  * \{ */
 
 /**
- * Create a new, non-existing folder name, returns 1 if successful, 0 if name couldn't be created.
+ * Create a new, non-existing folder name, returns true if successful,
+ * false if name couldn't be created.
  * The actual name is returned in 'name', 'folder' contains the complete path,
  * including the new folder name.
  */
-static int new_folder_path(const char *parent, char *folder, char *name)
+static bool new_folder_path(const char *parent, char folder[FILE_MAX], char name[FILE_MAXFILE])
 {
   int i = 1;
   int len = 0;
 
   BLI_strncpy(name, "New Folder", FILE_MAXFILE);
-  BLI_join_dirfile(folder, FILE_MAX, parent, name); /* XXX, not real length */
+  BLI_join_dirfile(folder, FILE_MAX, parent, name);
   /* check whether folder with the name already exists, in this case
    * add number to the name. Check length of generated name to avoid
    * crazy case of huge number of folders each named 'New Folder (x)' */
   while (BLI_exists(folder) && (len < FILE_MAXFILE)) {
     len = BLI_snprintf(name, FILE_MAXFILE, "New Folder(%d)", i);
-    BLI_join_dirfile(folder, FILE_MAX, parent, name); /* XXX, not real length */
+    BLI_join_dirfile(folder, FILE_MAX, parent, name);
     i++;
   }



More information about the Bf-blender-cvs mailing list