mirror of https://github.com/OISF/suricata
runmodes: work around format truncation warnings
util-runmodes.c: In function 'RunModeSetLiveCaptureAutoFp':
util-runmodes.c:167:30: warning: '%02d' directive output may be truncated writing between 2 and 11 bytes into a region of size between 3 and 4 [-Wformat-truncation=]
167 | "%s#%02d-%s", thread_name, thread+1,
| ^~~~
util-runmodes.c:167:26: note: directive argument in the range [-2147483647, 2147483647]
167 | "%s#%02d-%s", thread_name, thread+1,
| ^~~~~~~~~~~~
util-runmodes.c:167:26: note: assuming directive output of 1 byte
util-runmodes.c:166:17: note: 'snprintf' output 5 or more bytes (assuming 16) into a destination of size 5
166 | snprintf(printable_threadname, strlen(thread_name)+5+strlen(dev),
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
167 | "%s#%02d-%s", thread_name, thread+1,
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
168 | dev);
| ~~~~
util-runmodes.c: In function 'RunModeSetLiveCaptureWorkersForDevice':
util-runmodes.c:280:88: warning: '%02d' directive output may be truncated writing between 2 and 10 bytes into a region of size between 3 and 4 [-Wformat-truncation=]
280 | snprintf(printable_threadname, strlen(thread_name)+5+strlen(live_dev), "%s#%02d-%s",
| ^~~~
util-runmodes.c:280:84: note: directive argument in the range [1, 2147483647]
280 | snprintf(printable_threadname, strlen(thread_name)+5+strlen(live_dev), "%s#%02d-%s",
| ^~~~~~~~~~~~
util-runmodes.c:280:84: note: assuming directive output of 1 byte
util-runmodes.c:280:13: note: 'snprintf' output 5 or more bytes (assuming 15) into a destination of size 5
280 | snprintf(printable_threadname, strlen(thread_name)+5+strlen(live_dev), "%s#%02d-%s",
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
281 | thread_name, thread+1, live_dev);
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
util-runmodes.c:275:91: warning: '%s' directive output may be truncated writing likely 1 or more bytes into a region of size between 0 and 1 [-Wformat-truncation=]
275 | snprintf(printable_threadname, strlen(thread_name)+5+strlen(live_dev), "%s#01-%s",
| ^~
util-runmodes.c:275:84: note: assuming directive output of 1 byte
275 | snprintf(printable_threadname, strlen(thread_name)+5+strlen(live_dev), "%s#01-%s",
| ^~~~~~~~~~
util-runmodes.c:275:13: note: 'snprintf' output 5 or more bytes (assuming 7) into a destination of size 5
275 | snprintf(printable_threadname, strlen(thread_name)+5+strlen(live_dev), "%s#01-%s",
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
276 | thread_name, live_dev);
| ~~~~~~~~~~~~~~~~~~~~~~
Ticket: #7905.
pull/13926/head
parent
1f46e2ba09
commit
5817afa356
Loading…
Reference in New Issue