Only hardcoding indices right next to the array initilizer makes it easier to understand the code where these pointers are referred to. Signed-off-by: Alyssa Ross <hi@alyssa.is> --- release/checks/integration/networking.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/release/checks/integration/networking.c b/release/checks/integration/networking.c index 1e5983f..7331c4a 100644 --- a/release/checks/integration/networking.c +++ b/release/checks/integration/networking.c @@ -209,6 +209,8 @@ static FILE *start_qemu(struct config c) "-serial", "unix:console", nullptr, }; + char **efi_arg = &args[2], **img_arg = &args[4], + **user_data_arg = &args[6]; if (!(arch = getenv("ARCH"))) { uname(&u); @@ -229,9 +231,9 @@ static FILE *start_qemu(struct config c) exit(EXIT_FAILURE); } - if (asprintf(&args[2], "file=%s,format=raw,if=pflash,readonly=true", c.drives.efi) == -1 || - asprintf(&args[4], "file=%s,format=raw,if=virtio,readonly=true", c.drives.img) == -1 || - asprintf(&args[6], "file=%s,format=raw,if=virtio,readonly=true", c.drives.user_data) == -1) { + if (asprintf(efi_arg, "file=%s,format=raw,if=pflash,readonly=true", c.drives.efi) == -1 || + asprintf(img_arg, "file=%s,format=raw,if=virtio,readonly=true", c.drives.img) == -1 || + asprintf(user_data_arg, "file=%s,format=raw,if=virtio,readonly=true", c.drives.user_data) == -1) { perror("asprintf"); exit(EXIT_FAILURE); } -- 2.49.0