../hw/dmx/config/dmxparse.c: In function ‘dmxConfigCreateOption’:
../hw/dmx/config/dmxparse.c:385:13: warning: ‘strncpy’ output truncated before terminating nul copying as many bytes from a string as its length [-Wstringop-truncation]
strncpy(option->string + offset, p->string, len);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../hw/dmx/config/dmxparse.c:383:23: note: length computed here
int len = strlen(p->string);
^~~~~~~~~~~~~~~~~
The thing it's warning about is intentional, the surrounding code does
its own nul-termination. Make that obvious by using memcpy instead.
Signed-off-by: Adam Jackson <ajax@redhat.com>
Acked-by: Keith Packard <keithp@keithp.com>
|
||
|---|---|---|
| .. | ||
| man | ||
| .gitignore | ||
| Canvas.c | ||
| Canvas.h | ||
| CanvasP.h | ||
| Makefile.am | ||
| TODO | ||
| dmxcompat.c | ||
| dmxcompat.h | ||
| dmxconfig.c | ||
| dmxconfig.h | ||
| dmxparse.c | ||
| dmxparse.h | ||
| dmxprint.c | ||
| dmxprint.h | ||
| dmxtodmx.c | ||
| meson.build | ||
| parser.y | ||
| scanner.l | ||
| test-a.in | ||
| test-a.out | ||
| test-b.in | ||
| test-b.out | ||
| test-c.in | ||
| test-c.out | ||
| test-d.in | ||
| test-d.out | ||
| test-e.in | ||
| test-e.out | ||
| test-f.in | ||
| test-f.out | ||
| test-g.in | ||
| test-g.out | ||
| test-h.in | ||
| test-h.out | ||
| test-i.in | ||
| test-i.out | ||
| test-j.in | ||
| test-j.out | ||
| test-k.in | ||
| test-k.out | ||
| test-l.in | ||
| test-l.out | ||
| vdltodmx.c | ||
| xdmxconfig.c | ||