pkarashchenko commented on a change in pull request #1063:
URL: 
https://github.com/apache/incubator-nuttx-apps/pull/1063#discussion_r825660667



##########
File path: testing/fatutf8/fatutf8_main.c
##########
@@ -108,6 +109,7 @@ int main(int argc, FAR char *argv[])
 
   printf("\n");
 
+  strcpy(dir_path, path);

Review comment:
       I do not think that removal of a directory unconditionally is a good 
idea. What if directory existed already and was intentionally created by user? 
The removal in such case will be confusing. Can we better check if directory is 
already created and delete only if it was created by this code? 

##########
File path: testing/fatutf8/fatutf8_main.c
##########
@@ -166,5 +168,28 @@ int main(int argc, FAR char *argv[])
       exit(fd);
     }
 
+  printf("\n");
+
+  ret = remove(path);
+  if (ret == 0)
+    {
+      printf("removed %s\n", path);
+      ret = remove(dir_path);

Review comment:
       Maybe we can use next code instead of adding new variable to stack?
   ```
   basepath = strrchr(path, '/');
   if (basepath != NULL)
     {
       *basepath = '\0';
       ret = remove(path);
       if (ret == 0)
   ...
     }
   ```

##########
File path: testing/fatutf8/fatutf8_main.c
##########
@@ -61,6 +61,7 @@ int main(int argc, FAR char *argv[])
 
   char buf[128];
   char path[256];
+  char dir_path[256];

Review comment:
       ```suggestion
     char path[PATH_MAX];
     char dir_path[PATH_MAX];
   ```




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to