jlaitine commented on code in PR #17122:
URL: https://github.com/apache/nuttx/pull/17122#discussion_r2391124276
##########
binfmt/binfmt_loadmodule.c:
##########
@@ -122,6 +122,12 @@ static int load_absmodule(FAR struct binary_s *bin, FAR
const char *filename,
binfo("Successfully loaded module %s\n", filename);
+ /* Save the filename of the loaded module */
+
+#ifdef CONFIG_BINFMT_STORE_FILENAME
+ strlcpy(bin->fname, filename, sizeof(bin->fname));
Review Comment:
sizeof(bin->fname) evaluates at compile time to the defined size of the
fname vector, i.e. NAME_MAX in this case. Using sizeof here just avoids
defining the size in two places, that is, if size of the fname is changed in
the struct, there is no need to change it also in here.
Having said that, I can change it in here if you like it better!
--
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]