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



##########
File path: netutils/webserver/httpd_dirlist.c
##########
@@ -193,11 +193,8 @@ ssize_t httpd_dirlist(int outfd, FAR struct httpd_fs_file 
*file)
           break;
         }
 
-      path = malloc(CONFIG_NAME_MAX);
-      ASSERT(path);
-
-      snprintf(path, CONFIG_NAME_MAX, "%s/%s",
-               file->path, dent->d_name);
+      ret = asprintf(&path, "%s/%s", file->path, dent->d_name);
+      ASSERT(ret >= 0 && path);

Review comment:
       ```suggestion
         ASSERT(ret > 0 && path);
   ```
   so at least "/" should be printed




-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to