mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-06 07:18:17 +02:00
freedreno/cffdec: Fix format overflow warning.
../src/freedreno/decode/cffdec.c: In function ‘reg_disasm_gpuaddr’:
../src/freedreno/decode/cffdec.c:404:29: error: ‘sprintf’ writing a
terminating nul past the end of the destination [-Werror=format-overflow=]
404 | sprintf(filename, "%04d.%s", n++, ext);
../src/freedreno/decode/cffdec.c:404:3: note: ‘sprintf’ output between
9 and 16 bytes into a destination of size 8
404 | sprintf(filename, "%04d.%s", n++, ext);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7224>
This commit is contained in:
parent
e4dba528ca
commit
91c5bbc128
1 changed files with 1 additions and 1 deletions
|
|
@ -399,7 +399,7 @@ dump_shader(const char *ext, void *buf, int bufsz)
|
|||
{
|
||||
if (options->dump_shaders) {
|
||||
static int n = 0;
|
||||
char filename[8];
|
||||
char filename[16];
|
||||
int fd;
|
||||
sprintf(filename, "%04d.%s", n++, ext);
|
||||
fd = open(filename, O_WRONLY| O_TRUNC | O_CREAT, 0644);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue