[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v3 12/27] disas/m68k: Replace sprintf() by snprintf()
|
From: |
Richard Henderson |
|
Subject: |
[PATCH v3 12/27] disas/m68k: Replace sprintf() by snprintf() |
|
Date: |
Fri, 12 Apr 2024 00:33:31 -0700 |
From: Philippe Mathieu-Daudé <philmd@linaro.org>
sprintf() is deprecated on Darwin since macOS 13.0 / XCode 14.1,
resulting in painful developper experience. Use snprintf() instead.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Message-Id: <20240411104340.6617-2-philmd@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
disas/m68k.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/disas/m68k.c b/disas/m68k.c
index 1f16e295ab..800b4145ac 100644
--- a/disas/m68k.c
+++ b/disas/m68k.c
@@ -1000,7 +1000,7 @@ print_indexed (int basereg,
/* Generate the text for the index register.
Where this will be output is not yet determined. */
- sprintf (buf, "%s:%c%s",
+ snprintf(buf, sizeof(buf), "%s:%c%s",
reg_names[(word >> 12) & 0xf],
(word & 0x800) ? 'l' : 'w',
scales[(word >> 9) & 3]);
--
2.34.1
- Re: [PATCH v3 02/27] util/hexdump: Remove ascii parameter from qemu_hexdump_line, (continued)
- [PATCH v3 04/27] util/hexdump: Add unit_len and block_len to qemu_hexdump_line, Richard Henderson, 2024/04/12
- [PATCH v3 06/27] hw/mips/malta: Add re-usable rng_seed_hex_new() method, Richard Henderson, 2024/04/12
- [PATCH v3 07/27] system/qtest: Replace sprintf by qemu_hexdump_line, Richard Henderson, 2024/04/12
- [PATCH v3 09/27] hw/ide/atapi: Use qemu_hexdump_line to avoid sprintf, Richard Henderson, 2024/04/12
- [PATCH v3 10/27] hw/dma/pl330: Use qemu_hexdump_line to avoid sprintf, Richard Henderson, 2024/04/12
- [PATCH v3 08/27] hw/scsi/scsi-disk: Use qemu_hexdump_line to avoid sprintf, Richard Henderson, 2024/04/12
- [PATCH v3 12/27] disas/m68k: Replace sprintf() by snprintf(),
Richard Henderson <=
- [PATCH v3 13/27] disas/microblaze: Replace sprintf() by snprintf(), Richard Henderson, 2024/04/12
- [PATCH v3 15/27] target/microblaze: Re-indent print_insn_microblaze, Richard Henderson, 2024/04/12
- [PATCH v3 14/27] disas/microblaze: Split out print_immval_addr, Richard Henderson, 2024/04/12
- [PATCH v3 16/27] disas/microblaze: Merge op->name output into each fprintf, Richard Henderson, 2024/04/12
- [PATCH v3 11/27] backends/tpm: Use qemu_hexdump_line to avoid sprintf, Richard Henderson, 2024/04/12
- [PATCH v3 05/27] util/hexdump: Inline g_string_append_printf "%02x", Richard Henderson, 2024/04/12
- [PATCH v3 17/27] disas/microblaze: Print registers directly with PRIreg, Richard Henderson, 2024/04/12
- [PATCH v3 23/27] hw/misc/imx: Replace sprintf() by snprintf(), Richard Henderson, 2024/04/12