Skip to content

fix compiling error for snprintf ( under Raspberry Pi OS Debian Bullseye )#63

Open
sprhawk wants to merge 1 commit intorockchip-linux:masterfrom
iotpi-rockchip:iotpi
Open

fix compiling error for snprintf ( under Raspberry Pi OS Debian Bullseye )#63
sprhawk wants to merge 1 commit intorockchip-linux:masterfrom
iotpi-rockchip:iotpi

Conversation

@sprhawk
Copy link

@sprhawk sprhawk commented Mar 4, 2022

it compiles failed without changes:

main.cpp:1493:36: error: ‘%s’ directive output may be truncated writing up to 557 bytes into a region of size 15 [-Werror=format-truncation=]
 1493 |  snprintf(buffer, sizeof(buffer), "%s", chip);
      |                                    ^~
......
main.cpp:1493:10: note: ‘snprintf’ output between 1 and 558 bytes into a destination of size 15
 1493 |  snprintf(buffer, sizeof(buffer), "%s", chip);
      |  ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1plus: all warnings being treated as errors

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.

1 participant