You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2021/11/29 15:05:53 UTC

[GitHub] [incubator-nuttx-apps] hartmannathan commented on pull request #904: netutils/dhcpc: add non-blocking interface

hartmannathan commented on pull request #904:
URL: https://github.com/apache/incubator-nuttx-apps/pull/904#issuecomment-981720272


   Looks like I'm late to the party but LGTM.
   
   Just one question:
   
   Are we sure we want to remove the typecast from the (void *) returned by malloc() to (FAR struct dhcpc_state_s *) in this call:
   
   ```
   -pdhcpc = (FAR struct dhcpc_state_s *)malloc(sizeof(struct dhcpc_state_s));
   +pdhcpc = malloc(sizeof(struct dhcpc_state_s) + maclen - 1);
   ```
   
   Some compilers may warn about that.
   
   Might also benefit from a comment explaining the `maclen - 1` such as:
   
   ```
   /* maclen - 1: First byte of maclen is included in the structure */
   ```
   
   So that someone in the future won't think it's a mistake.


-- 
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-unsubscribe@nuttx.apache.org

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