aboutsummaryrefslogtreecommitdiff
path: root/target/arm
diff options
context:
space:
mode:
authorPhilippe Mathieu-Daudé <philmd@linaro.org>2024-04-11 12:31:44 +0200
committerPhilippe Mathieu-Daudé <philmd@linaro.org>2024-06-04 10:02:39 +0200
commit2ad9d04492434b9143f52535cfd12aaae1cfd667 (patch)
tree59b6befeeafb1e6498d59fe62f079e9232106a56 /target/arm
parentc76b288d780dd46716cf64743b88e885c6456679 (diff)
target/arm: Replace sprintf() by snprintf()
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-9-philmd@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Diffstat (limited to 'target/arm')
-rw-r--r--target/arm/cpu64.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/target/arm/cpu64.c b/target/arm/cpu64.c
index 862d2b92fa..262a1d6c0b 100644
--- a/target/arm/cpu64.c
+++ b/target/arm/cpu64.c
@@ -437,7 +437,7 @@ void aarch64_add_sve_properties(Object *obj)
for (vq = 1; vq <= ARM_MAX_VQ; ++vq) {
char name[8];
- sprintf(name, "sve%d", vq * 128);
+ snprintf(name, sizeof(name), "sve%d", vq * 128);
object_property_add(obj, name, "bool", cpu_arm_get_vq,
cpu_arm_set_vq, NULL, &cpu->sve_vq);
}
@@ -462,7 +462,7 @@ void aarch64_add_sme_properties(Object *obj)
for (vq = 1; vq <= ARM_MAX_VQ; vq <<= 1) {
char name[8];
- sprintf(name, "sme%d", vq * 128);
+ snprintf(name, sizeof(name), "sme%d", vq * 128);
object_property_add(obj, name, "bool", cpu_arm_get_vq,
cpu_arm_set_vq, NULL, &cpu->sme_vq);
}