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 2019/02/20 08:15:16 UTC

[GitHub] amrbekhit opened a new issue #1653: config functions don't work when the string is a constant

amrbekhit opened a new issue #1653: config functions don't work when the string is a constant
URL: https://github.com/apache/mynewt-core/issues/1653
 
 
   Some of the config module functions (e.g. conf_get_value) don't work when the string is a const. Because these functions internally use strtok_r, which modifies the original string, if the string passed into the function is a const (such as a string literal), the function will fail to tokenize the string properly. The workaround in the user code is to copy the config name to a temporary variable and pass that into the function.
   
   Perhaps it might a good idea to have the config functions do this themselves internally, as it's not obvious in the documentation that this is the behaviour and it's a difficult bug to diagnose.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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


With regards,
Apache Git Services