You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by GitBox <gi...@apache.org> on 2020/10/24 06:57:41 UTC

[GitHub] [mynewt-core] apache-mynewt-bot commented on pull request #2402: hw/battery: Fix strncpy warning

apache-mynewt-bot commented on pull request #2402:
URL: https://github.com/apache/mynewt-core/pull/2402#issuecomment-715820537


   
   <!-- style-bot -->
   
   ## Style check summary
   
   ### Our coding style is [here!](https://github.com/apache/mynewt-core/blob/master/CODING_STANDARDS.md)
   
   
   #### hw/battery/src/battery.c
   <details>
   
   ```diff
   @@ -369,12 +368,12 @@
    
    char *
    battery_prop_get_name(const struct battery_property *prop, char *buf,
   -        size_t buf_size)
   +                      size_t buf_size)
    {
        struct battery *bat = battery_manager.bm_batteries[prop->bp_bat_num];
        struct battery_driver *driver = bat->b_drivers[prop->bp_drv_num];
        const struct battery_driver_property *driver_prop =
   -            &driver->bd_driver_properties[prop->bp_prop_num - driver->bd_first_property];
   +        &driver->bd_driver_properties[prop->bp_prop_num - driver->bd_first_property];
    
        strncpy(buf, driver_prop->bdp_name, buf_size - 1);
        buf[buf_size - 1] = '\0';
   ```
   
   </details>


----------------------------------------------------------------
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.

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