tests/qtest/aspeed_gpio-test: Use g_strdup_printf() instead of char arrays
Older versions of gcc with -Wformat-overflow=2 don't like the usage of fixed size char arrays in this test; gcc 7.5.0 (SUSE Linux) says: ../tests/qtest/aspeed_gpio-test.c: In function ‘test_set_input_pins’: ../tests/qtest/aspeed_gpio-test.c:149:36: error: ‘sprintf’ may write a terminating nul past the end of the destination [-Werror=format-overflow=] sprintf(name, "gpio%c%d", c, i); ^ ../tests/qtest/aspeed_gpio-test.c:149:13: note: ‘sprintf’ output between 7 and 17 bytes into a destination of size 16 sprintf(name, "gpio%c%d", c, i); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ This can't actually happen because of the limited size of the values being substituted in. However rather than require readers to check whether the arrays really have been declared large enough, we prefer to use g_strdup_printf() for this kind of string work. Reported-by: Fabiano Rosas <farosas@suse.de> Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Tested-by: Fabiano Rosas <farosas@suse.de> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Message-id: 20260310153334.3063224-3-peter.maydell@linaro.org