Skip to content

Commit

Permalink
sdk/modules/audio: Fix a compile warning
Browse files Browse the repository at this point in the history
Use strlcpy instead of strncpy.
  • Loading branch information
SPRESENSE committed Mar 6, 2023
1 parent 750fcbb commit 3489937
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions sdk/modules/audio/include/audio_state.h
Expand Up @@ -63,8 +63,7 @@ class AudioState
AudioState(uint32_t mod_id, FAR const char* name, T state)
{
m_mod_id = mod_id;
strncpy(m_name, name, sizeof(m_name));
m_name[4] = '\0';
strlcpy(m_name, name, sizeof(m_name));
m_state = state;
}

Expand Down

0 comments on commit 3489937

Please sign in to comment.