Skip to content

Properly allocate string and remove warning #2652

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 12, 2019
Merged

Properly allocate string and remove warning #2652

merged 2 commits into from
Apr 12, 2019

Conversation

skrenes
Copy link
Contributor

@skrenes skrenes commented Apr 10, 2019

The former way generates the following warning:
ISO C++ forbids converting a string constant to 'char*'

This change makes a character array the size of the string with null ending. It's clearer and gets rid of the warning.

The former way generates the following warning:
ISO C++ forbids converting a string constant to 'char*'

This change makes a character array the size of the string with null ending. It's clearer and gets rid of the warning.
@me-no-dev
Copy link
Member

Actually proper fix is to change it to const char * :)

Since this is technically immutable, the type should reflect this too.
@skrenes
Copy link
Contributor Author

skrenes commented Apr 11, 2019

Actually proper fix is to change it to const char * :)

Agreed! A lapse in my judgment.

@me-no-dev me-no-dev merged commit 1412606 into espressif:master Apr 12, 2019
@me-no-dev
Copy link
Member

Thanks :)

@skrenes skrenes deleted the patch-1 branch June 21, 2019 00:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants