Skip to content

Commit

Permalink
ASoC: wcd_cpe_core: Fix snprintf size
Browse files Browse the repository at this point in the history
techpack/audio/asoc/codecs/wcd_cpe_core.c:1981:2: error: 'snprintf' size argument is too large; destination buffer has size 11, but size argument is 13 [-Werror,-Wfortify-source]
        snprintf(proc_name, (sizeof("cpe") + sizeof("_state") +
        ^
1 error generated.

Change-Id: I976c005263f44d7a97f1496304acf28df30232a1
  • Loading branch information
ArianK16a authored and Abhinavgupta371 committed Sep 29, 2023
1 parent 042b497 commit 482215e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions techpack/audio/asoc/codecs/wcd_cpe_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -1978,8 +1978,8 @@ struct wcd_cpe_core *wcd_cpe_init(const char *img_fname,
}

card = codec->component.card->snd_card;
snprintf(proc_name, (sizeof("cpe") + sizeof("_state") +
sizeof(id) - 2), "%s%d%s", cpe_name, id, state_name);
snprintf(proc_name, WCD_CPE_STATE_MAX_LEN,
"%s%d%s", cpe_name, id, state_name);
entry = snd_info_create_card_entry(card, proc_name,
card->proc_root);
if (entry) {
Expand Down

0 comments on commit 482215e

Please sign in to comment.