gcc 11 warning
polluks opened this issue · 0 comments
polluks commented
cc -c -Wall -O2 ex.c
ex.c: In function 'ex_exec':
ex.c:240:34: warning: '%s' directive output may be truncated writing up to 511 bytes into a region of size between 0 and 511 [-Wformat-truncation=]
snprintf(hln, sizeof(hln), "%s %s\n", hdr, val);
^~ ~~~
ex.c:240:3: note: 'snprintf' output between 3 and 1025 bytes into a destination of size 512
snprintf(hln, sizeof(hln), "%s %s\n", hdr, val);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~